[clang] Allow installation of Clang .cfg files if they where generated. (PR #105580)
via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 22 20:26:20 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
Author: Vladimir Vereschaka (vvereschaka)
<details>
<summary>Changes</summary>
Add 'install-clang-configs' target to install the build-generated configuration files (.cfg) into the destination 'bin' folder together with clang[++] executables.
The build-generated configuration files are expecting in `${LLVM_BINARY_DIR}/bin` folder.
---
Full diff: https://github.com/llvm/llvm-project/pull/105580.diff
1 Files Affected:
- (modified) clang/CMakeLists.txt (+16)
``````````diff
diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt
index c6496167d3828b..f3494ab9e3f207 100644
--- a/clang/CMakeLists.txt
+++ b/clang/CMakeLists.txt
@@ -413,6 +413,22 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
endif()
endif()
+# Install build-generated Clang configuration files (if presented).
+install(DIRECTORY ${LLVM_BINARY_DIR}/bin/
+ TYPE BIN
+ COMPONENT clang-configs
+ FILES_MATCHING
+ PATTERN "*.cfg"
+ )
+add_custom_target(clang-configs DEPENDS clang)
+set_target_properties(clang-configs PROPERTIES FOLDER "Clang/Configurations")
+if(NOT LLVM_ENABLE_IDE)
+ # Add a dummy target so this can be used with LLVM_DISTRIBUTION_COMPONENTS.
+ add_llvm_install_targets(install-clang-configs
+ DEPENDS clang-configs
+ COMPONENT clang-configs)
+endif()
+
option(CLANG_BUILD_TOOLS
"Build the Clang tools. If OFF, just generate build targets." ON)
``````````
</details>
https://github.com/llvm/llvm-project/pull/105580
More information about the cfe-commits
mailing list