cmake: fix sanitizer detenction on mac 135/head
authorMichael Wallner <mike@php.net>
Mon, 20 Feb 2023 17:34:40 +0000 (18:34 +0100)
committerMichael Wallner <mike@php.net>
Tue, 21 Feb 2023 15:55:11 +0000 (16:55 +0100)
CMake/CheckDebug.cmake

index fb188529afed4551c3daa189a65159e1b81405e4..a280d16a0d4edc0591b235a5ffa96e35ce41df41 100644 (file)
@@ -15,7 +15,7 @@ macro(check_sanitizer VAR NAME LIB)
     if(${NAME} IN_LIST ${VAR} OR ${LIB} IN_LIST ${VAR})
         make_have_identifier(${LIB} HAVE)
         cmake_push_check_state(RESET)
-        set(CMAKE_REQUIRED_LIBRARIES ${LIB})
+        set(CMAKE_REQUIRED_LIBRARIES -fsanitize=${NAME})
         check_cxx_compiler_flag(-fsanitize=${NAME} ${HAVE})
         cmake_pop_check_state()
         if(${HAVE})