smeenai created this revision.
smeenai added reviewers: beanz, phosek.
Herald added subscribers: jdoerfert, mgorny.
Herald added a project: clang.
smeenai added a comment.

I'm not entirely happy with the name clang-dev-headers, and am open to 
suggestions. It's unfortunate clang-headers was already taken for something 
different, but renaming that target or increasing its scope seems bad for 
existing users. Other possibilities I thought of include clang-tooling-headers, 
though that might be confused with the headers for libTooling specifically, and 
clang-library-headers. I'm open to suggestions.


Add an install target for clang's development 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. This differs from the existing
clang-headers target in that clang-headers is for clang's resource
directory headers, whereas the new target is for clang's development
headers (corresponding to its libraries).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D58317

Files:
  clang/CMakeLists.txt


Index: clang/CMakeLists.txt
===================================================================
--- clang/CMakeLists.txt
+++ clang/CMakeLists.txt
@@ -383,6 +383,7 @@
 if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
   install(DIRECTORY include/clang include/clang-c
     DESTINATION include
+    COMPONENT clang-dev-headers
     FILES_MATCHING
     PATTERN "*.def"
     PATTERN "*.h"
@@ -392,12 +393,23 @@
 
   install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/clang
     DESTINATION include
+    COMPONENT clang-dev-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-dev-headers DEPENDS clang-tablegen-targets)
+  set_target_properties(clang-dev-headers PROPERTIES FOLDER "Misc")
+  if(NOT LLVM_ENABLE_IDE)
+    add_llvm_install_targets(install-clang-dev-headers
+                             DEPENDS clang-dev-headers
+                             COMPONENT clang-dev-headers)
+  endif()
+
   install(PROGRAMS utils/bash-autocomplete.sh
     DESTINATION share/clang
     )


Index: clang/CMakeLists.txt
===================================================================
--- clang/CMakeLists.txt
+++ clang/CMakeLists.txt
@@ -383,6 +383,7 @@
 if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
   install(DIRECTORY include/clang include/clang-c
     DESTINATION include
+    COMPONENT clang-dev-headers
     FILES_MATCHING
     PATTERN "*.def"
     PATTERN "*.h"
@@ -392,12 +393,23 @@
 
   install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/clang
     DESTINATION include
+    COMPONENT clang-dev-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-dev-headers DEPENDS clang-tablegen-targets)
+  set_target_properties(clang-dev-headers PROPERTIES FOLDER "Misc")
+  if(NOT LLVM_ENABLE_IDE)
+    add_llvm_install_targets(install-clang-dev-headers
+                             DEPENDS clang-dev-headers
+                             COMPONENT clang-dev-headers)
+  endif()
+
   install(PROGRAMS utils/bash-autocomplete.sh
     DESTINATION share/clang
     )
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to