[llvm-commits] [compiler-rt] r170897 - in /compiler-rt/trunk/lib: asan/tests/CMakeLists.txt sanitizer_common/CMakeLists.txt sanitizer_common/tests/CMakeLists.txt
Alexey Samsonov
samsonov at google.com
Fri Dec 21 06:04:53 PST 2012
Author: samsonov
Date: Fri Dec 21 08:04:52 2012
New Revision: 170897
URL: http://llvm.org/viewvc/llvm-project?rev=170897&view=rev
Log:
[Sanitizer] CMake build rules for unittests: depend on headers when compiling a file with custom clang.
Modified:
compiler-rt/trunk/lib/asan/tests/CMakeLists.txt
compiler-rt/trunk/lib/sanitizer_common/CMakeLists.txt
compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt
Modified: compiler-rt/trunk/lib/asan/tests/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/tests/CMakeLists.txt?rev=170897&r1=170896&r2=170897&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/tests/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/asan/tests/CMakeLists.txt Fri Dec 21 08:04:52 2012
@@ -16,6 +16,11 @@
include_directories(..)
include_directories(../..)
+set(ASAN_UNITTEST_HEADERS
+ asan_mac_test.h
+ asan_test_config.h
+ asan_test_utils.h)
+
set(ASAN_UNITTEST_COMMON_CFLAGS
${COMPILER_RT_GTEST_INCLUDE_CFLAGS}
-I${COMPILER_RT_SOURCE_DIR}/include
@@ -89,6 +94,7 @@
clang_compile(${output_obj} ${source}
CFLAGS ${ARGN} ${TARGET_CFLAGS}
DEPS gtest ${ASAN_RUNTIME_LIBRARIES}
+ ${ASAN_UNITTEST_HEADERS}
${ASAN_BLACKLIST_FILE})
list(APPEND ${obj_list} ${output_obj})
endmacro()
Modified: compiler-rt/trunk/lib/sanitizer_common/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/CMakeLists.txt?rev=170897&r1=170896&r2=170897&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/sanitizer_common/CMakeLists.txt Fri Dec 21 08:04:52 2012
@@ -20,6 +20,30 @@
sanitizer_win.cc
)
+# Explicitly list all sanitizer_common headers. Not all of these are
+# included in sanitizer_common source files, but we need to depend on
+# headers when building our custom unit tests.
+set(SANITIZER_HEADERS
+ sanitizer_allocator.h
+ sanitizer_atomic_clang.h
+ sanitizer_atomic_msvc.h
+ sanitizer_atomic.h
+ sanitizer_common.h
+ sanitizer_common_interceptors.h
+ sanitizer_flags.h
+ sanitizer_internal_defs.h
+ sanitizer_libc.h
+ sanitizer_list.h
+ sanitizer_mutex.h
+ sanitizer_placement_new.h
+ sanitizer_platform_interceptors.h
+ sanitizer_procmaps.h
+ sanitizer_report_decorator.h
+ sanitizer_stackdepot.h
+ sanitizer_stacktrace.h
+ sanitizer_symbolizer.h
+ )
+
set(SANITIZER_CFLAGS ${SANITIZER_COMMON_CFLAGS})
set(SANITIZER_RUNTIME_LIBRARIES)
Modified: compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt?rev=170897&r1=170896&r2=170897&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt Fri Dec 21 08:04:52 2012
@@ -12,6 +12,11 @@
sanitizer_test_main.cc
)
+set(SANITIZER_TEST_HEADERS)
+foreach(header ${SANITIZER_HEADERS})
+ list(APPEND SANITIZER_TEST_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/../${header})
+endforeach()
+
include_directories(..)
include_directories(../..)
@@ -55,7 +60,8 @@
set(output_obj "${basename}.${arch}.o")
clang_compile(${output_obj} ${source}
CFLAGS ${SANITIZER_TEST_CFLAGS}
- DEPS gtest ${SANITIZER_RUNTIME_LIBRARIES})
+ DEPS gtest ${SANITIZER_RUNTIME_LIBRARIES}
+ ${SANITIZER_TEST_HEADERS})
list(APPEND SANITIZER_TEST_OBJECTS ${output_obj})
endforeach()
get_sanitizer_common_lib_for_arch(${arch} SANITIZER_COMMON_LIB
More information about the llvm-commits
mailing list