[clang] [HLSL][CMake] Add clangd and distribution settings (PR #92011)

Chris B via cfe-commits cfe-commits at lists.llvm.org
Mon May 13 12:01:28 PDT 2024


https://github.com/llvm-beanz updated https://github.com/llvm/llvm-project/pull/92011

>From e1b82c5bb1869ac74080e17633bd8ac7931a47b6 Mon Sep 17 00:00:00 2001
From: Chris B <cbieneman at microsoft.com>
Date: Mon, 13 May 2024 13:55:49 -0500
Subject: [PATCH 1/2] [HLSL][CMake] Add clangd and distribution settings

This just adds some simple distribution settings and includes clangd in
the build for distribution.
---
 clang/cmake/caches/HLSL.cmake | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/clang/cmake/caches/HLSL.cmake b/clang/cmake/caches/HLSL.cmake
index 84850c86f12cd..9aa28625ab81e 100644
--- a/clang/cmake/caches/HLSL.cmake
+++ b/clang/cmake/caches/HLSL.cmake
@@ -8,6 +8,10 @@ set(LLVM_EXPERIMENTAL_TARGETS_TO_BUILD "DirectX;SPIRV" CACHE STRING "")
 
 # HLSL support is currently limted to clang, eventually it will expand to
 # clang-tools-extra too.
-set(LLVM_ENABLE_PROJECTS "clang" CACHE STRING "")
+set(LLVM_ENABLE_PROJECTS "clang;clang-tools-extra" CACHE STRING "")
 
 set(CLANG_ENABLE_HLSL On CACHE BOOL "")
+
+set(LLVM_DISTRIBUTION_COMPONENTS
+    "clang;hlsl-resource-headers;clangd"
+    CACHE STRING "")

>From b0f54990e3a5b9bb56c573d13af748b51e3c6115 Mon Sep 17 00:00:00 2001
From: Chris B <cbieneman at microsoft.com>
Date: Mon, 13 May 2024 14:00:42 -0500
Subject: [PATCH 2/2] Don't setup distribuiton on multi-config generators

---
 clang/cmake/caches/HLSL.cmake | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/clang/cmake/caches/HLSL.cmake b/clang/cmake/caches/HLSL.cmake
index 9aa28625ab81e..27f848fdccf0c 100644
--- a/clang/cmake/caches/HLSL.cmake
+++ b/clang/cmake/caches/HLSL.cmake
@@ -12,6 +12,8 @@ set(LLVM_ENABLE_PROJECTS "clang;clang-tools-extra" CACHE STRING "")
 
 set(CLANG_ENABLE_HLSL On CACHE BOOL "")
 
-set(LLVM_DISTRIBUTION_COMPONENTS
-    "clang;hlsl-resource-headers;clangd"
-    CACHE STRING "")
+if (NOT CMAKE_CONFIGURATION_TYPES)
+  set(LLVM_DISTRIBUTION_COMPONENTS
+      "clang;hlsl-resource-headers;clangd"
+      CACHE STRING "")
+endif()



More information about the cfe-commits mailing list