[clang] Allow installation of Clang .cfg files if they where generated. (PR #105580)

Vladimir Vereschaka via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 21 13:42:00 PDT 2024


https://github.com/vvereschaka created https://github.com/llvm/llvm-project/pull/105580

Add 'install-clang-configs' target to install generated configuration files into the destination 'bin' folder together with clang[++] executables.

>From d0e2e1e4037519daaca93b34b069d395c24fc469 Mon Sep 17 00:00:00 2001
From: Vladimir Vereschaka <vvereschaka at accesssoftek.com>
Date: Wed, 21 Aug 2024 13:37:47 -0700
Subject: [PATCH] Allow installation of Clang .cfg files if they where
 generated.

Add 'install-clang-configs' target to install generated configuration
files into the destination 'bin' folder together with clang[++] executables.
---
 clang/CMakeLists.txt | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt
index c6496167d3828b..96cabcfd50c3f2 100644
--- a/clang/CMakeLists.txt
+++ b/clang/CMakeLists.txt
@@ -413,6 +413,22 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
   endif()
 endif()
 
+# Install 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_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)
 



More information about the cfe-commits mailing list