diff --git a/share/cmake/utils/CheckSupportSSE2.cmake b/share/cmake/utils/CheckSupportSSE2.cmake index 3d97bf8a0a..f30bbb763c 100644 --- a/share/cmake/utils/CheckSupportSSE2.cmake +++ b/share/cmake/utils/CheckSupportSSE2.cmake @@ -3,6 +3,8 @@ include(CheckCXXSourceCompiles) +set(_cmake_required_flags_old "${CMAKE_REQUIRED_FLAGS}") + if(NOT CMAKE_SIZE_OF_VOID_P EQUAL 8) # As CheckCXXCompilerFlag implicitly uses CMAKE_CXX_FLAGS some custom flags could trigger # unrelated warnings causing a detection failure. So, the code disables all warnings to focus @@ -27,4 +29,7 @@ check_cxx_source_compiles (" }" HAVE_SSE2) +set(CMAKE_REQUIRED_FLAGS "${_cmake_required_flags_old}") +unset(_cmake_required_flags_old) + mark_as_advanced(HAVE_SSE2)