Skip to content

Commit

Permalink
COMPL: Add option for clang and GCC for -ffp-contract=off.
Browse files Browse the repository at this point in the history
This will guarantee results between versions of Clang and GCC.

Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
  • Loading branch information
imikejackson committed Feb 5, 2024
1 parent e084926 commit 5dfb133
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Source/EbsdLib/SourceList.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,16 @@ target_link_libraries(${PROJECT_NAME}
if(WIN32 AND BUILD_SHARED_LIBS)
target_compile_definitions(${PROJECT_NAME} PUBLIC "-DEbsdLib_BUILT_AS_DYNAMIC_LIB")
endif()


# --------------------------------------------------------------------
# This is here to enable consistent results for some of the operations
# with newer versions of Clang. Clang versions above verison 14 default
# this to ON where as before it was OFF. This can have the effect of
# changing outputs between clang versions.
target_compile_options( ${PROJECT_NAME} PUBLIC
$<$<CXX_COMPILER_ID:GNU,Clang,AppleClang,Intel>: "-ffp-contract=off">
)

LibraryProperties(${PROJECT_NAME} ${EXE_DEBUG_EXTENSION})

if(EbsdLib_USE_PARALLEL_ALGORITHMS)
Expand Down

0 comments on commit 5dfb133

Please sign in to comment.