File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -148,6 +148,8 @@ else()
148148 set (WARNMODE "no-" )
149149endif ()
150150
151+ option (USE_FAST_MATH "Use fast math" ON )
152+
151153option (USE_DEBUG_FPE "Use floating point exceptions" OFF )
152154
153155if (USE_DEBUG_FPE)
@@ -157,7 +159,11 @@ endif()
157159# Compiler options
158160if (MSVC )
159161 set_c_cxx_flag("/MP" )
160- set_c_cxx_flag("/fp:fast" )
162+
163+ if (USE_FAST_MATH)
164+ set_c_cxx_flag("/fp:fast" )
165+ endif ()
166+
161167 set_c_cxx_flag("/d2Zi+" RELWITHDEBINFO)
162168
163169 # https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/
@@ -244,7 +250,9 @@ else()
244250 endif ()
245251
246252 # Optimizations.
247- set_c_cxx_flag("-ffast-math" )
253+ if (USE_FAST_MATH)
254+ set_c_cxx_flag("-ffast-math" )
255+ endif ()
248256
249257 if (USE_DEBUG_FPE)
250258 # Floating point exceptions requires trapping math
You can’t perform that action at this time.
0 commit comments