From 86b48923887d47437e6ef021f1d8107c1043b8fd Mon Sep 17 00:00:00 2001 From: Artur Harasimiuk Date: Tue, 19 Feb 2019 13:23:14 +0100 Subject: [PATCH] don't use sanitizer when building ocloc Change-Id: I910802b95e338414300f1b307444331801f3c87a Signed-off-by: Artur Harasimiuk --- CMakeLists.txt | 4 ++-- offline_compiler/CMakeLists.txt | 3 +-- unit_tests/CMakeLists.txt | 4 +++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7312698409..6a79564fbf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -503,7 +503,7 @@ else() if(USE_ASAN) if(CMAKE_COMPILER_IS_GNUCC) set(ASAN_FLAGS " -fsanitize=address -fno-omit-frame-pointer") - link_libraries(asan) + set(ASAN_LIBS "asan") else() message(STATUS "Address sanitization with clang not yet support") endif() @@ -511,7 +511,7 @@ else() if(USE_TSAN) if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") set(TSAN_FLAGS " -fsanitize=thread") - link_libraries(tsan) + set(TSAN_LIBS "tsan") else() message(STATUS "Thread sanitization with gcc is not fully supported") endif() diff --git a/offline_compiler/CMakeLists.txt b/offline_compiler/CMakeLists.txt index 9c23415074..fc59003751 100644 --- a/offline_compiler/CMakeLists.txt +++ b/offline_compiler/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright (C) 2018 Intel Corporation +# Copyright (C) 2018-2019 Intel Corporation # # SPDX-License-Identifier: MIT # @@ -100,7 +100,6 @@ endif() target_link_libraries(ocloc elflib) set_target_properties(ocloc PROPERTIES FOLDER "offline_compiler") -set_property(TARGET ocloc APPEND_STRING PROPERTY COMPILE_FLAGS ${ASAN_FLAGS} ${TSAN_FLAGS}) add_custom_target(copy_compiler_files DEPENDS ${IGDRCL__IGC_TARGETS}) set_target_properties(copy_compiler_files PROPERTIES FOLDER "opencl runtime") diff --git a/unit_tests/CMakeLists.txt b/unit_tests/CMakeLists.txt index 70059b1ea8..8cd4c4fba4 100644 --- a/unit_tests/CMakeLists.txt +++ b/unit_tests/CMakeLists.txt @@ -26,6 +26,8 @@ if(WIN32) string(REPLACE "/O2" "/Od" CMAKE_C_FLAGS_RELEASEINTERNAL ${CMAKE_C_FLAGS_RELEASEINTERNAL}) endif() +link_libraries(${ASAN_LIBS} ${TSAN_LIBS}) + add_custom_target(unit_tests) add_custom_target(run_unit_tests ALL) @@ -465,4 +467,4 @@ if(MSVC) target_sources(igdrcl_tests PRIVATE ${IGDRCL_SRCS_ult_pch}) endif() -# Dont add any sources below PCH logic. This is to keep PCH dependencies correctly without creating new target \ No newline at end of file +# Dont add any sources below PCH logic. This is to keep PCH dependencies correctly without creating new target