From 8369c56cd1080466e11e39cd564719ca3cbdc862 Mon Sep 17 00:00:00 2001 From: Ag <17752104+agamache@users.noreply.github.com> Date: Tue, 5 May 2026 19:09:01 -0400 Subject: [PATCH] Compile with -ffp-contract=off on arm64 macOS --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4429cc59943..261ef566137 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -121,6 +121,10 @@ set(CMAKE_C_FLAGS_RELEASE "-O2 -DNDEBUG") set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG") set(CMAKE_OBJCXX_FLAGS_RELEASE "-O2 -DNDEBUG") endif() +# IEEE 754 compliant floating-point rounding on arm64 macOS +if (CMAKE_SYSTEM_NAME STREQUAL "Darwin") + add_compile_options(-Xarch_arm64 -ffp-contract=off) +endif() if(NOT CMAKE_BUILD_TYPE ) set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Choose the type of build." FORCE)