Skip to content

Commit 5dfb133

Browse files
committed
COMPL: Add option for clang and GCC for -ffp-contract=off.
This will guarantee results between versions of Clang and GCC. Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
1 parent e084926 commit 5dfb133

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Source/EbsdLib/SourceList.cmake

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,16 @@ target_link_libraries(${PROJECT_NAME}
161161
if(WIN32 AND BUILD_SHARED_LIBS)
162162
target_compile_definitions(${PROJECT_NAME} PUBLIC "-DEbsdLib_BUILT_AS_DYNAMIC_LIB")
163163
endif()
164-
164+
165+
# --------------------------------------------------------------------
166+
# This is here to enable consistent results for some of the operations
167+
# with newer versions of Clang. Clang versions above verison 14 default
168+
# this to ON where as before it was OFF. This can have the effect of
169+
# changing outputs between clang versions.
170+
target_compile_options( ${PROJECT_NAME} PUBLIC
171+
$<$<CXX_COMPILER_ID:GNU,Clang,AppleClang,Intel>: "-ffp-contract=off">
172+
)
173+
165174
LibraryProperties(${PROJECT_NAME} ${EXE_DEBUG_EXTENSION})
166175

167176
if(EbsdLib_USE_PARALLEL_ALGORITHMS)

0 commit comments

Comments
 (0)