Skip to content

Commit c741c56

Browse files
authored
Not report undefined symbols when in sanitizer build.
Not report undefined symbols when in sanitizer build, sanitizers do not support this flag. With this flag, it will lead to linker errors when trying to build with sanitizers.
1 parent 8c0846c commit c741c56

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

CMakeLists.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,9 +298,12 @@ if (WIN32)
298298
elseif(UNIX)
299299
set_property(TARGET ${TARGET_NAME} APPEND_STRING PROPERTY
300300
COMPILE_DEFINITIONS LIBOPENCL_CLANG_NAME="$<TARGET_SONAME_FILE_NAME:${TARGET_NAME}>")
301-
302-
set_property(TARGET ${TARGET_NAME} APPEND_STRING PROPERTY
303-
LINK_FLAGS " -Wl,--no-undefined")
301+
302+
# Sanitizers do not support this flag, disable this when under sanitizer build
303+
if(NOT LLVM_USE_SANITIZER)
304+
set_property(TARGET ${TARGET_NAME} APPEND_STRING PROPERTY
305+
LINK_FLAGS " -Wl,--no-undefined")
306+
endif()
304307
endif(WIN32)
305308

306309
install(FILES opencl_clang.h

0 commit comments

Comments
 (0)