Skip to content

Commit

Permalink
Fix regression tests for AppleClang on ARM64
Browse files Browse the repository at this point in the history
  • Loading branch information
pramsey committed Jan 10, 2024
1 parent a753ddf commit 5ab6d28
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
"$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>:-ffp-contract=off>"
"$<$<CXX_COMPILER_ID:GNU>:-ffp-contract=off>"
"$<$<CXX_COMPILER_ID:MSVC>:/fp:precise>"
)

#-----------------------------------------------------------------------------
# Target geos_cxx_flags: common compilation flags
#-----------------------------------------------------------------------------
Expand Down

0 comments on commit 5ab6d28

Please sign in to comment.