summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct9
1 files changed, 9 insertions, 0 deletions
diff --git a/SConstruct b/SConstruct
index ceda985c349..eddc24db0f5 100644
--- a/SConstruct
+++ b/SConstruct
@@ -1636,6 +1636,15 @@ if debugBuild:
else:
env.AppendUnique( CPPDEFINES=[ 'NDEBUG' ] )
+# Disable floating-point contractions such as forming of fused multiply-add operations.
+if env.ToolchainIs('clang', 'gcc'):
+ env.Append(CCFLAGS=["-ffp-contract=off"])
+else:
+ # msvc defaults to /fp:precise. Visual Studio 2022 does not emit floating-point contractions
+ # with /fp:precise, but previous versions can. Disable contractions altogether by using
+ # /fp:strict.
+ env.Append(CCFLAGS=["/fp:strict"])
+
if env.TargetOSIs('linux'):
env.Append( LIBS=["m"] )
if not env.TargetOSIs('android'):