[compiler-rt] r189577 - [sanitizer] Refine CMake rules for generating exported symbols and lint checking

Alexey Samsonov samsonov at google.com
Thu Aug 29 03:49:04 PDT 2013


Author: samsonov
Date: Thu Aug 29 05:49:04 2013
New Revision: 189577

URL: http://llvm.org/viewvc/llvm-project?rev=189577&view=rev
Log:
[sanitizer] Refine CMake rules for generating exported symbols and lint checking

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

Modified: compiler-rt/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/CMakeLists.txt?rev=189577&r1=189576&r2=189577&view=diff
==============================================================================
--- compiler-rt/trunk/CMakeLists.txt (original)
+++ compiler-rt/trunk/CMakeLists.txt Thu Aug 29 05:49:04 2013
@@ -191,6 +191,10 @@ add_subdirectory(include)
 set(SANITIZER_COMMON_LIT_TEST_DEPS
   clang clang-headers FileCheck count not llvm-nm llvm-symbolizer
   compiler-rt-headers)
+# Check code style when running lit tests for sanitizers.
+if(UNIX)
+  list(APPEND SANITIZER_COMMON_LIT_TEST_DEPS SanitizerLintCheck)
+endif()
 
 add_subdirectory(lib)
 

Modified: compiler-rt/trunk/cmake/Modules/SanitizerUtils.cmake
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/Modules/SanitizerUtils.cmake?rev=189577&r1=189576&r2=189577&view=diff
==============================================================================
--- compiler-rt/trunk/cmake/Modules/SanitizerUtils.cmake (original)
+++ compiler-rt/trunk/cmake/Modules/SanitizerUtils.cmake Thu Aug 29 05:49:04 2013
@@ -3,6 +3,9 @@ include(LLVMParseArguments)
 set(SANITIZER_GEN_DYNAMIC_LIST
   ${COMPILER_RT_SOURCE_DIR}/lib/sanitizer_common/scripts/gen_dynamic_list.py)
 
+set(SANITIZER_LINT_SCRIPT
+  ${COMPILER_RT_SOURCE_DIR}/lib/sanitizer_common/scripts/check_lint.sh)
+
 # Create a target "<name>-symbols" that would generate the list of symbols
 # that need to be exported from sanitizer runtime "<name>". Function
 # interceptors are exported automatically, user can also provide files with
@@ -11,13 +14,28 @@ set(SANITIZER_GEN_DYNAMIC_LIST
 macro(add_sanitizer_rt_symbols name)
   get_target_property(libfile ${name} LOCATION)
   set(symsfile "${libfile}.syms")
-  add_custom_target(${name}-symbols ALL
+  add_custom_command(OUTPUT ${symsfile}
     COMMAND ${PYTHON_EXECUTABLE}
       ${SANITIZER_GEN_DYNAMIC_LIST} ${libfile} ${ARGN}
       > ${symsfile}
     DEPENDS ${name} ${SANITIZER_GEN_DYNAMIC_LIST} ${ARGN}
     WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-    VERBATIM
+    COMMENT "Generating exported symbols for ${name}"
+    VERBATIM)
+  add_custom_target(${name}-symbols ALL
+    DEPENDS ${symsfile}
     SOURCES ${SANITIZER_GEN_DYNAMIC_LIST} ${ARGN})
   install(FILES ${symsfile} DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR})
 endmacro()
+
+# Add target to check code style for sanitizer runtimes.
+if(UNIX)
+  add_custom_target(SanitizerLintCheck
+    COMMAND LLVM_CHECKOUT=${LLVM_MAIN_SRC_DIR} SILENT=1 TMPDIR=
+      PYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}
+      ${SANITIZER_LINT_SCRIPT}
+    DEPENDS ${SANITIZER_LINT_SCRIPT}
+    COMMENT "Running lint check for sanitizer sources..."
+    VERBATIM)
+endif()
+

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=189577&r1=189576&r2=189577&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/sanitizer_common/CMakeLists.txt Thu Aug 29 05:49:04 2013
@@ -100,18 +100,6 @@ else()
   endforeach()
 endif()
 
-# Add target to check code style for sanitizer runtimes.
-if(UNIX)
-  set(SANITIZER_LINT_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/scripts/check_lint.sh)
-  add_custom_target(SanitizerLintCheck ALL
-    COMMAND LLVM_CHECKOUT=${LLVM_MAIN_SRC_DIR} SILENT=1 TMPDIR=
-      PYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}
-      ${SANITIZER_LINT_SCRIPT}
-    DEPENDS ${SANITIZER_LINT_SCRIPT}
-    COMMENT "Running lint check for sanitizer sources..."
-    VERBATIM)
-endif()
-
 # Unit tests for common sanitizer runtime.
 if(LLVM_INCLUDE_TESTS)
   add_subdirectory(tests)

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=189577&r1=189576&r2=189577&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt Thu Aug 29 05:49:04 2013
@@ -166,8 +166,3 @@ if(ANDROID)
   # Add unit test to test suite.
   add_dependencies(SanitizerUnitTests SanitizerTest)
 endif()
-
-# Check code style as a part of check-sanitizer command.
-if(UNIX)
-  add_dependencies(SanitizerUnitTests SanitizerLintCheck)
-endif()





More information about the llvm-commits mailing list