[llvm-commits] [compiler-rt] r172410 - /compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt

Evgeniy Stepanov eugeni.stepanov at gmail.com
Mon Jan 14 06:08:25 PST 2013


Author: eugenis
Date: Mon Jan 14 08:08:25 2013
New Revision: 172410

URL: http://llvm.org/viewvc/llvm-project?rev=172410&view=rev
Log:
Build rules for sanitizer_common tests on Android.

Modified:
    compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt

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=172410&r1=172409&r2=172410&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt Mon Jan 14 08:08:25 2013
@@ -111,3 +111,28 @@
     )
   set_target_properties(check-sanitizer PROPERTIES FOLDER "Sanitizer unittests")
 endif()
+
+if(ANDROID)
+  # We assume that unit tests on Android are built in a build
+  # tree with fresh Clang as a host compiler.
+  add_executable(SanitizerTest
+    ${SANITIZER_UNITTESTS}
+    ${COMPILER_RT_GTEST_SOURCE}
+    $<TARGET_OBJECTS:RTSanitizerCommon.arm.android>
+    )
+  set_target_compile_flags(SanitizerTest
+    ${SANITIZER_COMMON_CFLAGS}
+    ${COMPILER_RT_GTEST_INCLUDE_CFLAGS}
+    -I${COMPILER_RT_SOURCE_DIR}/include
+    -I${COMPILER_RT_SOURCE_DIR}/lib
+    -I${COMPILER_RT_SOURCE_DIR}/lib/sanitizer_common
+    -O2 -g
+    )
+  # Setup correct output directory and link flags.
+  get_unittest_directory(OUTPUT_DIR)
+  set_target_properties(AsanTest PROPERTIES
+    RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_DIR})
+  set_target_link_flags(SanitizerTest ${SANITIZER_TEST_LINK_FLAGS})
+  # Add unit test to test suite.
+  add_dependencies(SanitizerUnitTests SanitizerTest)
+endif()





More information about the llvm-commits mailing list