[compiler-rt] r246178 - [CMake] Add PARENT_TARGET option to add_sanitizer_rt_symbols.

Chris Bieneman via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 27 11:27:33 PDT 2015


Author: cbieneman
Date: Thu Aug 27 13:27:33 2015
New Revision: 246178

URL: http://llvm.org/viewvc/llvm-project?rev=246178&view=rev
Log:
[CMake] Add PARENT_TARGET option to add_sanitizer_rt_symbols.

Summary: This is another step in a multi-step refactoring to move add_sanitizer_rt_symbols in the direction of other add_* functions in compiler-rt.

Reviewers: filcab, bogner, kubabrecka, zaks.anna, glider, samsonov

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D12409

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

Modified: compiler-rt/trunk/cmake/Modules/SanitizerUtils.cmake
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/Modules/SanitizerUtils.cmake?rev=246178&r1=246177&r2=246178&view=diff
==============================================================================
--- compiler-rt/trunk/cmake/Modules/SanitizerUtils.cmake (original)
+++ compiler-rt/trunk/cmake/Modules/SanitizerUtils.cmake Thu Aug 27 13:27:33 2015
@@ -9,11 +9,12 @@ set(SANITIZER_LINT_SCRIPT
 # interceptors are exported automatically, user can also provide files with
 # symbol names that should be exported as well.
 #   add_sanitizer_rt_symbols(<name>
+#                            PARENT_TARGET <convenience parent target>
 #                            EXTRA <files with extra symbols to export>)
 macro(add_sanitizer_rt_symbols name)
   cmake_parse_arguments(ARG
     ""
-    ""
+    "PARENT_TARGET"
     "EXTRA"
     ${ARGN})
   set(stamp ${CMAKE_CURRENT_BINARY_DIR}/${name}.syms-stamp)
@@ -50,6 +51,9 @@ macro(add_sanitizer_rt_symbols name)
       install(FILES ${libfile}.syms DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR})
     endif()
   endif()
+  if(ARG_PARENT_TARGET)
+    add_dependencies(${ARG_PARENT_TARGET} ${name}-symbols)
+  endif()
 endmacro()
 
 macro(add_sanitizer_rt_version_list name)

Modified: compiler-rt/trunk/lib/ubsan/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/ubsan/CMakeLists.txt?rev=246178&r1=246177&r2=246178&view=diff
==============================================================================
--- compiler-rt/trunk/lib/ubsan/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/ubsan/CMakeLists.txt Thu Aug 27 13:27:33 2015
@@ -97,12 +97,11 @@ else()
     foreach(arch ${UBSAN_SUPPORTED_ARCH})
       if (UNIX AND NOT ${arch} MATCHES "i386|i686")
         add_sanitizer_rt_symbols(clang_rt.ubsan_standalone-${arch}
+          PARENT_TARGET ubsan
           EXTRA ubsan.syms.extra)
         add_sanitizer_rt_symbols(clang_rt.ubsan_standalone_cxx-${arch}
+          PARENT_TARGET ubsan
           EXTRA ubsan.syms.extra)
-        add_dependencies(ubsan
-          clang_rt.ubsan_standalone-${arch}-symbols
-          clang_rt.ubsan_standalone_cxx-${arch}-symbols)
       endif()
     endforeach()
   endif()




More information about the llvm-commits mailing list