]> granicus.if.org Git - clang/commitdiff
[clang] Use add_llvm_install_targets
authorShoaib Meenai <smeenai@fb.com>
Thu, 30 Nov 2017 22:35:02 +0000 (22:35 +0000)
committerShoaib Meenai <smeenai@fb.com>
Thu, 30 Nov 2017 22:35:02 +0000 (22:35 +0000)
Use this function to create the install targets rather than doing so
manually, which gains us the `-stripped` install targets to perform
stripped installations.

Differential Revision: https://reviews.llvm.org/D40675

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@319489 91177308-0d34-0410-b5e6-96231b3b80d8

cmake/modules/AddClang.cmake
lib/Headers/CMakeLists.txt
runtime/CMakeLists.txt
tools/c-index-test/CMakeLists.txt
tools/libclang/CMakeLists.txt

index e657059744a4ffa77115275f74ee298b6487d891..c09a8423f9f6d51afa2ecd237210bc66009f2793 100644 (file)
@@ -104,11 +104,9 @@ macro(add_clang_library name)
         RUNTIME DESTINATION bin)
 
       if (${ARG_SHARED} AND NOT CMAKE_CONFIGURATION_TYPES)
-        add_custom_target(install-${name}
-                          DEPENDS ${name}
-                          COMMAND "${CMAKE_COMMAND}"
-                                  -DCMAKE_INSTALL_COMPONENT=${name}
-                                  -P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
+        add_llvm_install_targets(install-${name}
+                                 DEPENDS ${name}
+                                 COMPONENT ${name})
       endif()
     endif()
     set_property(GLOBAL APPEND PROPERTY CLANG_EXPORTS ${name})
@@ -147,11 +145,9 @@ macro(add_clang_tool name)
       COMPONENT ${name})
 
     if(NOT CMAKE_CONFIGURATION_TYPES)
-      add_custom_target(install-${name}
-        DEPENDS ${name}
-        COMMAND "${CMAKE_COMMAND}"
-        -DCMAKE_INSTALL_COMPONENT=${name}
-        -P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
+      add_llvm_install_targets(install-${name}
+                               DEPENDS ${name}
+                               COMPONENT ${name})
     endif()
     set_property(GLOBAL APPEND PROPERTY CLANG_EXPORTS ${name})
   endif()
index f81bfa159f36c1712011d2be2272daeb1d92b1ab..acfd81716ad23298659a24103c0735303d457bcd 100644 (file)
@@ -141,9 +141,7 @@ install(
   DESTINATION lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include/cuda_wrappers)
 
 if (NOT CMAKE_CONFIGURATION_TYPES) # don't add this for IDE's.
-  add_custom_target(install-clang-headers
-    DEPENDS clang-headers
-    COMMAND "${CMAKE_COMMAND}"
-            -DCMAKE_INSTALL_COMPONENT=clang-headers
-            -P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
+  add_llvm_install_targets(install-clang-headers
+                           DEPENDS clang-headers
+                           COMPONENT clang-headers)
 endif()
index 2190f274924f5d0aa75ddd075fdd3f468e481402..af8ab163c7cdf3d575abdd03cbe2aeb1dfc1f884 100644 (file)
@@ -101,12 +101,9 @@ if(LLVM_BUILD_EXTERNAL_COMPILER_RT AND EXISTS ${COMPILER_RT_SRC_ROOT}/)
   install(CODE "execute_process\(COMMAND \${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX=\${CMAKE_INSTALL_PREFIX} -P ${BINARY_DIR}/cmake_install.cmake \)"
     COMPONENT compiler-rt)
 
-  add_custom_target(install-compiler-rt
-                    DEPENDS compiler-rt
-                    COMMAND "${CMAKE_COMMAND}"
-                             -DCMAKE_INSTALL_COMPONENT=compiler-rt
-                             -P "${CMAKE_BINARY_DIR}/cmake_install.cmake"
-                    USES_TERMINAL)
+  add_llvm_install_targets(install-compiler-rt
+                           DEPENDS compiler-rt
+                           COMPONENT compiler-rt)
 
   # Add top-level targets that build specific compiler-rt runtimes.
   set(COMPILER_RT_RUNTIMES fuzzer asan builtins dfsan lsan msan profile tsan ubsan ubsan-minimal)
index ad990e010eeff77027f67b5b14ab6e74b96389a4..c5cb0591c51573ec4b3571b687bb0f1927d5c35d 100644 (file)
@@ -56,10 +56,8 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
     COMPONENT c-index-test)
 
   if (NOT CMAKE_CONFIGURATION_TYPES) # don't add this for IDE's.
-    add_custom_target(install-c-index-test
-      DEPENDS c-index-test
-      COMMAND "${CMAKE_COMMAND}"
-              -DCMAKE_INSTALL_COMPONENT=c-index-test
-              -P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
+    add_llvm_install_targets(install-c-index-test
+                             DEPENDS c-index-test
+                             COMPONENT c-index-test)
   endif()
 endif()
index 3a51c6a5f2b7ca4262c831d92e8b22cf6cc7dca6..44406378207bbfefb7d792fc3d04904ae9383479 100644 (file)
@@ -148,9 +148,6 @@ add_custom_target(libclang-headers)
 set_target_properties(libclang-headers PROPERTIES FOLDER "Misc")
 
 if (NOT CMAKE_CONFIGURATION_TYPES) # don't add this for IDE's.
-  add_custom_target(install-libclang-headers
-    DEPENDS
-    COMMAND "${CMAKE_COMMAND}"
-            -DCMAKE_INSTALL_COMPONENT=libclang-headers
-            -P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
+  add_llvm_install_targets(install-libclang-headers
+                           COMPONENT libclang-headers)
 endif()