File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -169,6 +169,17 @@ else()
169169 set ( SC_BUILD_EXAMPLES ${T8CODE_BUILD_TPL_EXAMPLES} )
170170 set ( SC_BUILD_TESTING ${T8CODE_BUILD_TPL_TESTS} )
171171
172+ # When executing CMake tests for libsc, i.e. check_c_source_compiles/check_cxx_source_compiles and others
173+ # we need to ignore the -Werror option, since these tests often produce warnings (see check_mpicommshared.cmake for example).
174+ # If theses warnings are interpreted as errors, the test fails even though we want it to pass.
175+ # This behaviour caused a serious bug and did not initialize our shared memory. See https://github.com/DLR-AMR/t8code/issues/1985.
176+ set ( T8CODE_OLD_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} " )
177+ if (WIN32 )
178+ set (CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} /w" )
179+ else ()
180+ set (CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -w" )
181+ endif ()
182+
172183 # Capture the list of variables before adding the subdirectory to mark the added ones as advanced.
173184 get_cmake_property (_vars_before_sc VARIABLES )
174185 list ( APPEND CMAKE_MESSAGE_CONTEXT "sc" )
@@ -219,6 +230,10 @@ else()
219230 message (WARNING "mpi.h not found!" )
220231 endif ()
221232 ########################## End of fix for OpenMPI ############################################
233+
234+ # Reactivate previous CMAKE_REQUIRED_FLAGS
235+ set ( CMAKE_REQUIRED_FLAGS "${T8CODE_OLD_CMAKE_REQUIRED_FLAGS} " )
236+ unset ( T8CODE_OLD_CMAKE_REQUIRED_FLAGS )
222237endif ()
223238
224239if ( T8CODE_USE_SYSTEM_P4EST )
You can’t perform that action at this time.
0 commit comments