Skip to content

Commit 8fc5f97

Browse files
committed
MSVC: stop warning spam when USE_FAST_MATH off
1 parent 5d5b7ac commit 8fc5f97

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

cmake/DaemonFlags.cmake

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -173,20 +173,23 @@ option(USE_FLOAT_EXCEPTIONS "Use floating point exceptions with common.floatExce
173173
option(USE_FAST_MATH "Use fast math" ON)
174174

175175
if (USE_FLOAT_EXCEPTIONS)
176-
add_definitions(-DDAEMON_USE_FLOAT_EXCEPTIONS)
176+
add_definitions(-DDAEMON_USE_FLOAT_EXCEPTIONS)
177177
endif()
178178

179179
if (MSVC)
180180
set_c_cxx_flag("/MP")
181181

182-
if (USE_FLOAT_EXCEPTIONS)
183-
set_c_cxx_flag("/fp:strict")
184-
# Don't switch on C4305 "truncation from 'double' to 'float'" every
185-
# time an unsuffixed decimal constant is used
186-
set_c_cxx_flag("/wd4305")
187-
elseif (USE_FAST_MATH)
188-
set_c_cxx_flag("/fp:fast")
189-
endif()
182+
if (USE_FAST_MATH)
183+
set_c_cxx_flag("/fp:fast")
184+
else()
185+
# Don't switch on C4305 "truncation from 'double' to 'float'" every
186+
# time an unsuffixed decimal constant is used
187+
set_c_cxx_flag("/wd4305")
188+
endif()
189+
190+
if (USE_FLOAT_EXCEPTIONS)
191+
set_c_cxx_flag("/fp:strict")
192+
endif()
190193

191194
set_c_cxx_flag("/d2Zi+" RELWITHDEBINFO)
192195

0 commit comments

Comments
 (0)