summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorShoaib Meenai <smeenai@fb.com>2019-03-11 18:53:57 +0000
committerShoaib Meenai <smeenai@fb.com>2019-03-11 18:53:57 +0000
commit370e7be0099c9bf8d101edaa7736bff7a0593e95 (patch)
treec0e3d68937ded084f147eeccd966f0ebb26933c4 /CMakeLists.txt
parentcf1bcf5fdc1669bc01f35dba7fe793c6bb60588b (diff)
downloadclang-370e7be0099c9bf8d101edaa7736bff7a0593e95.tar.gz
[clang] Add install targets for API headers
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
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt12
1 files changed, 12 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index be9a93d3df..e36babd91d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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
)