diff --git a/build_files/cmake/platform/platform_apple.cmake b/build_files/cmake/platform/platform_apple.cmake index 20114191c52..33e817da449 100644 --- a/build_files/cmake/platform/platform_apple.cmake +++ b/build_files/cmake/platform/platform_apple.cmake @@ -174,7 +174,7 @@ if(SYSTEMSTUBS_LIBRARY) list(APPEND PLATFORM_LINKLIBS SystemStubs) endif() -string(APPEND PLATFORM_CFLAGS " -pipe -funsigned-char -fno-strict-aliasing") +string(APPEND PLATFORM_CFLAGS " -pipe -funsigned-char -fno-strict-aliasing -ffp-contract=off") set(PLATFORM_LINKFLAGS "-fexceptions -framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Cocoa -framework Carbon -framework AudioUnit -framework AudioToolbox -framework CoreAudio -framework Metal -framework QuartzCore" ) diff --git a/build_files/cmake/platform/platform_unix.cmake b/build_files/cmake/platform/platform_unix.cmake index 72de4c59203..a56363dbd43 100644 --- a/build_files/cmake/platform/platform_unix.cmake +++ b/build_files/cmake/platform/platform_unix.cmake @@ -803,8 +803,7 @@ if(CMAKE_COMPILER_IS_GNUCC) # Automatically turned on when building with "-march=native". This is # explicitly turned off here as it will make floating point math give a bit # different results. This will lead to automated test failures. So disable - # this until we support it. Seems to default to off in clang and the intel - # compiler. + # this until we support it. set(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing -ffp-contract=off") # `maybe-uninitialized` is unreliable in release builds, but fine in debug builds. @@ -892,7 +891,7 @@ if(CMAKE_COMPILER_IS_GNUCC) # CLang is the same as GCC for now. elseif(CMAKE_C_COMPILER_ID MATCHES "Clang") - set(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing") + set(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing -ffp-contract=off") if(WITH_LINKER_MOLD AND _IS_LINKER_DEFAULT) find_program(MOLD_BIN "mold")