[llvm-commits] [compiler-rt] r159343 - /compiler-rt/trunk/lib/asan/tests/CMakeLists.txt

Alexey Samsonov samsonov at google.com
Thu Jun 28 02:32:20 PDT 2012


Author: samsonov
Date: Thu Jun 28 04:32:19 2012
New Revision: 159343

URL: http://llvm.org/viewvc/llvm-project?rev=159343&view=rev
Log:
[ASan] update cmake rules so that ASan unit tests can include googletest (and, hence, llvm) headers when they are built by fresh Clang

Modified:
    compiler-rt/trunk/lib/asan/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=159343&r1=159342&r2=159343&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/tests/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/asan/tests/CMakeLists.txt Thu Jun 28 04:32:19 2012
@@ -30,6 +30,13 @@
 	asan_break_optimization.cc
 	)
 
+set(ASAN_EXTRA_CFLAGS
+  -I${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest/include
+  -I${LLVM_MAIN_SRC_DIR}/include
+  -I${LLVM_BINARY_DIR}/include
+  -D__STDC_CONSTANT_MACROS
+  -D__STDC_LIMIT_MACROS
+)
 
 # We only support building instrumented tests when we're not cross compiling
 # and targeting a unix-like system where we can predict viable compilation and
@@ -43,7 +50,7 @@
     add_custom_command(
       OUTPUT "${source}.asan.o"
       COMMAND clang
-              -faddress-sanitizer ${ASAN_CFLAGS}
+              -faddress-sanitizer ${ASAN_CFLAGS} ${ASAN_EXTRA_CFLAGS}
               -mllvm "-asan-blacklist=${CMAKE_CURRENT_SOURCE_DIR}/asan_test.ignore"
               -DASAN_HAS_BLACKLIST=1
               -DASAN_HAS_EXCEPTIONS=1





More information about the llvm-commits mailing list