]> granicus.if.org Git - clang/commitdiff
[clang] Add install targets for API headers
authorShoaib Meenai <smeenai@fb.com>
Mon, 11 Mar 2019 18:53:57 +0000 (18:53 +0000)
committerShoaib Meenai <smeenai@fb.com>
Mon, 11 Mar 2019 18:53:57 +0000 (18:53 +0000)
Add an install target for clang's API headers, which allows them to be
included in distributions. The install rules already existed, but they
lacked a component and a target, making them only accessible via a full
install. These headers are useful for writing clang-based tooling, for
example. They're the clang equivalent to the llvm-headers target and
complement the clang-libraries target.

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

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

CMakeLists.txt
docs/ReleaseNotes.rst

index be9a93d3df743b0648c2af9fb7a2dfcb684ca178..e36babd91d0bab258c4111d9d95865bc7c663e66 100644 (file)
@@ -388,6 +388,7 @@ include_directories(BEFORE
 if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
   install(DIRECTORY include/clang include/clang-c
     DESTINATION include
+    COMPONENT clang-headers
     FILES_MATCHING
     PATTERN "*.def"
     PATTERN "*.h"
@@ -397,12 +398,23 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
 
   install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/clang
     DESTINATION include
+    COMPONENT clang-headers
     FILES_MATCHING
     PATTERN "CMakeFiles" EXCLUDE
     PATTERN "*.inc"
     PATTERN "*.h"
     )
 
+  # Installing the headers needs to depend on generating any public
+  # tablegen'd headers.
+  add_custom_target(clang-headers DEPENDS clang-tablegen-targets)
+  set_target_properties(clang-headers PROPERTIES FOLDER "Misc")
+  if(NOT LLVM_ENABLE_IDE)
+    add_llvm_install_targets(install-clang-headers
+                             DEPENDS clang-headers
+                             COMPONENT clang-headers)
+  endif()
+
   install(PROGRAMS utils/bash-autocomplete.sh
     DESTINATION share/clang
     )
index 1ca6218ac64f15915134bc64bf90164a16b6f959..14f5f5e21aa8d583d6c350e214558ebca46d4d84 100644 (file)
@@ -156,7 +156,9 @@ release of Clang. Users of the build system should adjust accordingly.
 - In 8.0.0 and below, the install-clang-headers target would install clang's
   resource directory headers. This installation is now performed by the
   install-clang-resource-headers target. Users of the old install-clang-headers
-  target should switch to the new install-clang-resource-headers target.
+  target should switch to the new install-clang-resource-headers target. The
+  install-clang-headers target now installs clang's API headers (corresponding
+  to its libraries), which is consistent with the install-llvm-headers target.
 
 -  ...