diff --git a/CMakeLists.txt b/CMakeLists.txt index cd210afb23..bf9590f65f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -154,6 +154,20 @@ set(CMAKE_CXX_EXTENSIONS OFF) add_library(geos_cxx_flags INTERFACE) target_compile_features(geos_cxx_flags INTERFACE cxx_std_11) +#----------------------------------------------------------------------------- +# Add flags to prevent 'fused multiply-add' operations on targets (ARM64) +# that allow it, as it breaks calculations in DD.cpp. +# TODO: Replace DD calculations with 'long float' where target supports +# true long float, and remove other cases where FMA causes regression +# failures. +# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98207 +#----------------------------------------------------------------------------- +target_compile_options(geos_cxx_flags INTERFACE + "$<$,$>:-ffp-contract=off>" + "$<$:-ffp-contract=off>" + "$<$:/fp:precise>" + ) + #----------------------------------------------------------------------------- # Target geos_cxx_flags: common compilation flags #-----------------------------------------------------------------------------