cmake: use link_libraries() instead of add_link_options() for sanitizers
authorMichael Wallner <mike@php.net>
Tue, 29 Sep 2020 11:42:47 +0000 (13:42 +0200)
committerMichael Wallner <mike@php.net>
Tue, 29 Sep 2020 11:42:47 +0000 (13:42 +0200)
CMake/CheckDebug.cmake

index 4ab87f259fa37806ec8fa16db97412d348f09e9c..2c873d86959b4530840b7f27dbe6b2263104e0ff 100644 (file)
@@ -49,7 +49,7 @@ function(check_debug)
                 if(HAVE_ASAN)
                     add_compile_definitions(HAVE_ASAN)
                     add_compile_options(-fsanitize=address)
-                    add_link_options(-lasan)
+                    link_libraries(asan)
                     check_flag(-fsanitize-recover=address IGNORE)
                 endif()
             endif()
@@ -62,7 +62,7 @@ function(check_debug)
                 if(HAVE_UBSAN)
                     add_compile_definitions(HAVE_UBSAN)
                     add_compile_options(-fsanitize=undefined)
-                    add_link_options(-lubsan)
+                    link_libraries(ubsan)
                     check_flag(-fsanitize-recover=undefined IGNORE)
                 endif()
             endif()