[compiler-rt] r201556 - [CMake] Add top-level target for each compiler-rt library, and add 'compiler-rt' target encompassing them all.

Alexey Samsonov samsonov at google.com
Tue Feb 18 01:33:46 PST 2014


Author: samsonov
Date: Tue Feb 18 03:33:45 2014
New Revision: 201556

URL: http://llvm.org/viewvc/llvm-project?rev=201556&view=rev
Log:
[CMake] Add top-level target for each compiler-rt library, and add 'compiler-rt' target encompassing them all.

Modified:
    compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake
    compiler-rt/trunk/cmake/Modules/SanitizerUtils.cmake
    compiler-rt/trunk/lib/asan/CMakeLists.txt
    compiler-rt/trunk/lib/builtins/CMakeLists.txt
    compiler-rt/trunk/lib/dfsan/CMakeLists.txt
    compiler-rt/trunk/lib/lsan/CMakeLists.txt
    compiler-rt/trunk/lib/msan/CMakeLists.txt
    compiler-rt/trunk/lib/profile/CMakeLists.txt
    compiler-rt/trunk/lib/sanitizer_common/CMakeLists.txt
    compiler-rt/trunk/lib/tsan/CMakeLists.txt
    compiler-rt/trunk/lib/ubsan/CMakeLists.txt

Modified: compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake?rev=201556&r1=201555&r2=201556&view=diff
==============================================================================
--- compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake (original)
+++ compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake Tue Feb 18 03:33:45 2014
@@ -58,7 +58,6 @@ macro(add_compiler_rt_static_runtime nam
     # Add installation command.
     install(TARGETS ${name}
       ARCHIVE DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR})
-    add_dependencies(compiler-rt ${name})
   else()
     message(FATAL_ERROR "Archtecture ${arch} can't be targeted")
   endif()
@@ -81,7 +80,6 @@ macro(add_compiler_rt_osx_static_runtime
     ARCHIVE_OUTPUT_DIRECTORY ${COMPILER_RT_LIBRARY_OUTPUT_DIR})
   install(TARGETS ${name}
     ARCHIVE DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR})
-  add_dependencies(compiler-rt ${name})
 endmacro()
 
 # Adds dynamic runtime library on osx/iossim, which supports multiple
@@ -104,7 +102,6 @@ macro(add_compiler_rt_darwin_dynamic_run
     LIBRARY_OUTPUT_DIRECTORY ${COMPILER_RT_LIBRARY_OUTPUT_DIR})
   install(TARGETS ${name}
     LIBRARY DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR})
-  add_dependencies(compiler-rt ${name})
 endmacro()
 
 # Unittests support.

Modified: compiler-rt/trunk/cmake/Modules/SanitizerUtils.cmake
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/Modules/SanitizerUtils.cmake?rev=201556&r1=201555&r2=201556&view=diff
==============================================================================
--- compiler-rt/trunk/cmake/Modules/SanitizerUtils.cmake (original)
+++ compiler-rt/trunk/cmake/Modules/SanitizerUtils.cmake Tue Feb 18 03:33:45 2014
@@ -26,7 +26,6 @@ macro(add_sanitizer_rt_symbols name)
     DEPENDS ${symsfile}
     SOURCES ${SANITIZER_GEN_DYNAMIC_LIST} ${ARGN})
   install(FILES ${symsfile} DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR})
-  add_dependencies(compiler-rt ${name}-symbols)
 endmacro()
 
 # Add target to check code style for sanitizer runtimes.

Modified: compiler-rt/trunk/lib/asan/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/CMakeLists.txt?rev=201556&r1=201555&r2=201556&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/asan/CMakeLists.txt Tue Feb 18 03:33:45 2014
@@ -127,6 +127,7 @@ endif()
 
 add_compiler_rt_resource_file(asan_blacklist asan_blacklist.txt)
 add_dependencies(asan asan_blacklist)
+add_dependencies(compiler-rt asan)
 
 if(LLVM_INCLUDE_TESTS)
   add_subdirectory(tests)

Modified: compiler-rt/trunk/lib/builtins/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/builtins/CMakeLists.txt?rev=201556&r1=201555&r2=201556&view=diff
==============================================================================
--- compiler-rt/trunk/lib/builtins/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/builtins/CMakeLists.txt Tue Feb 18 03:33:45 2014
@@ -222,12 +222,17 @@ set(arm_SOURCES
   arm/unordsf2vfp.S
   ${GENERIC_SOURCES})
 
+add_custom_target(builtins)
+
 if (NOT WIN32)
   foreach(arch x86_64 i386 arm)
     if(CAN_TARGET_${arch})
       add_compiler_rt_static_runtime(clang_rt.${arch} ${arch}
         SOURCES ${${arch}_SOURCES}
         CFLAGS "-std=c99")
+      add_dependencies(builtins clang_rt.${arch})
     endif()
   endforeach()
 endif()
+
+add_dependencies(compiler-rt builtins)

Modified: compiler-rt/trunk/lib/dfsan/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/dfsan/CMakeLists.txt?rev=201556&r1=201555&r2=201556&view=diff
==============================================================================
--- compiler-rt/trunk/lib/dfsan/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/dfsan/CMakeLists.txt Tue Feb 18 03:33:45 2014
@@ -44,3 +44,5 @@ add_custom_command(OUTPUT ${CLANG_RESOUR
 add_dependencies(dfsan dfsan_abilist)
 install(FILES ${CLANG_RESOURCE_DIR}/dfsan_abilist.txt
         DESTINATION ${LIBCLANG_INSTALL_PATH})
+
+add_dependencies(compiler-rt dfsan)

Modified: compiler-rt/trunk/lib/lsan/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/lsan/CMakeLists.txt?rev=201556&r1=201555&r2=201556&view=diff
==============================================================================
--- compiler-rt/trunk/lib/lsan/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/lsan/CMakeLists.txt Tue Feb 18 03:33:45 2014
@@ -48,3 +48,5 @@ elseif(NOT ANDROID)
     add_dependencies(lsan clang_rt.lsan-${arch})
   endforeach()
 endif()
+
+add_dependencies(compiler-rt lsan)

Modified: compiler-rt/trunk/lib/msan/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/CMakeLists.txt?rev=201556&r1=201555&r2=201556&view=diff
==============================================================================
--- compiler-rt/trunk/lib/msan/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/msan/CMakeLists.txt Tue Feb 18 03:33:45 2014
@@ -35,6 +35,7 @@ endif()
 
 add_compiler_rt_resource_file(msan_blacklist msan_blacklist.txt)
 add_dependencies(msan msan_blacklist)
+add_dependencies(compiler-rt msan)
 
 if(LLVM_INCLUDE_TESTS)
   add_subdirectory(tests)

Modified: compiler-rt/trunk/lib/profile/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/CMakeLists.txt?rev=201556&r1=201555&r2=201556&view=diff
==============================================================================
--- compiler-rt/trunk/lib/profile/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/profile/CMakeLists.txt Tue Feb 18 03:33:45 2014
@@ -4,14 +4,20 @@ set(PROFILE_SOURCES
 
 filter_available_targets(PROFILE_SUPPORTED_ARCH x86_64 i386 arm)
 
+add_custom_target(profile)
+
 if(APPLE)
   add_compiler_rt_osx_static_runtime(clang_rt.profile_osx
     ARCH ${PROFILE_SUPPORTED_ARCH}
     SOURCES ${PROFILE_SOURCES})
+  add_dependencies(profile clang_rt.profile_osx)
 else()
   foreach(arch ${PROFILE_SUPPORTED_ARCH})
     add_compiler_rt_static_runtime(clang_rt.profile-${arch}
       ${arch}
       SOURCES ${PROFILE_SOURCES})
+    add_dependencies(profile clang_rt.profile-${arch})
   endforeach()
 endif()
+
+add_dependencies(compiler-rt profile)

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=201556&r1=201555&r2=201556&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/sanitizer_common/CMakeLists.txt Tue Feb 18 03:33:45 2014
@@ -94,6 +94,7 @@ append_no_rtti_flag(SANITIZER_CFLAGS)
 append_if(SANITIZER_CFLAGS COMPILER_RT_HAS_WFRAME_LARGER_THAN_FLAG -Wframe-larger-than=512)
 append_if(SANITIZER_CFLAGS COMPILER_RT_HAS_WGLOBAL_CONSTRUCTORS_FLAG -Wglobal-constructors)
 
+add_custom_target(sanitizer_common)
 set(SANITIZER_RUNTIME_LIBRARIES)
 if(APPLE)
   # Build universal binary on APPLE.
@@ -122,16 +123,19 @@ else()
     add_compiler_rt_object_library(RTSanitizerCommonLibc ${arch}
       SOURCES ${SANITIZER_LIBCDEP_SOURCES} CFLAGS ${SANITIZER_CFLAGS}
       DEFS ${SANITIZER_COMMON_DEFINITIONS})
+    list(APPEND SANITIZER_RUNTIME_LIBRARIES RTSanitizerCommon.${arch}
+                                            RTSanitizerCommonLibc.${arch})
     add_compiler_rt_static_runtime(clang_rt.san-${arch} ${arch}
       SOURCES $<TARGET_OBJECTS:RTSanitizerCommon.${arch}>
               $<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}>
       CFLAGS ${SANITIZER_CFLAGS}
       DEFS ${SANITIZER_COMMON_DEFINITIONS})
-    list(APPEND SANITIZER_RUNTIME_LIBRARIES RTSanitizerCommon.${arch}
-                                            RTSanitizerCommonLibc.${arch})
+    add_dependencies(sanitizer_common clang_rt.san-${arch})
   endforeach()
 endif()
 
+add_dependencies(compiler-rt sanitizer_common)
+
 # Unit tests for common sanitizer runtime.
 if(LLVM_INCLUDE_TESTS)
   add_subdirectory(tests)

Modified: compiler-rt/trunk/lib/tsan/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/CMakeLists.txt?rev=201556&r1=201555&r2=201556&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/tsan/CMakeLists.txt Tue Feb 18 03:33:45 2014
@@ -71,6 +71,8 @@ if(CAN_TARGET_x86_64 AND UNIX AND NOT AP
     clang_rt.tsan-${arch}-symbols)
 endif()
 
+add_dependencies(compiler-rt tsan)
+
 if(LLVM_INCLUDE_TESTS)
   add_subdirectory(tests)
 endif()

Modified: compiler-rt/trunk/lib/ubsan/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/ubsan/CMakeLists.txt?rev=201556&r1=201555&r2=201556&view=diff
==============================================================================
--- compiler-rt/trunk/lib/ubsan/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/ubsan/CMakeLists.txt Tue Feb 18 03:33:45 2014
@@ -49,3 +49,5 @@ else()
     endif()
   endforeach()
 endif()
+
+add_dependencies(compiler-rt ubsan)





More information about the llvm-commits mailing list