[libclc] [libclc][CMake] Add COMPONENT ${ARG_PARENT_TARGET} to install (PR #182716)

Wenju He via cfe-commits cfe-commits at lists.llvm.org
Sat Feb 21 17:51:33 PST 2026


https://github.com/wenju-he created https://github.com/llvm/llvm-project/pull/182716

Toolchain can specify the component to explicitly install libclc to a deploy folder. E.g. our downstream SYCL toolchain deploy: https://github.com/intel/llvm/blob/e7b423fd517d/sycl/CMakeLists.txt#L531

Also check ARG_PARENT_TARGET is defined and non-empty.

>From f56c2023ddf80d322156aee65484c4aae5e3fe42 Mon Sep 17 00:00:00 2001
From: Wenju He <wenju.he at intel.com>
Date: Sun, 22 Feb 2026 02:50:32 +0100
Subject: [PATCH] [libclc][CMake] Add COMPONENT ${ARG_PARENT_TARGET} to install

Toolchain can specify the component to explicitly install libclc to
a deploy folder. E.g. our downstream SYCL toolchain deploy:
https://github.com/intel/llvm/blob/e7b423fd517d/sycl/CMakeLists.txt#L531

Also check ARG_PARENT_TARGET is defined and non-empty.

Co-authored-by: Jinsong Ji <jinsong.ji at intel.com>
---
 libclc/cmake/modules/AddLibclc.cmake | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libclc/cmake/modules/AddLibclc.cmake b/libclc/cmake/modules/AddLibclc.cmake
index c4e7ddee79f12..6e7b32df61740 100644
--- a/libclc/cmake/modules/AddLibclc.cmake
+++ b/libclc/cmake/modules/AddLibclc.cmake
@@ -374,6 +374,10 @@ function(add_libclc_builtin_set)
     return()
   endif()
 
+  if (NOT DEFINED ARG_PARENT_TARGET OR ARG_PARENT_TARGET STREQUAL "")
+    message(FATAL_ERROR "PARENT_TARGET parameter is required and must be non-empty.")
+  endif()
+
   if (NOT DEFINED ARG_OUTPUT_FILENAME OR ARG_OUTPUT_FILENAME STREQUAL "")
     message(FATAL_ERROR "OUTPUT_FILENAME parameter is required and must be non-empty.")
   endif()
@@ -439,6 +443,7 @@ function(add_libclc_builtin_set)
   install(
     FILES ${libclc_builtins_lib}
     DESTINATION ${LIBCLC_INSTALL_DIR}/${ARG_TRIPLE}
+    COMPONENT ${ARG_PARENT_TARGET}
   )
 
   # SPIR-V targets can exit early here
@@ -490,6 +495,7 @@ function(add_libclc_builtin_set)
     install(
       FILES ${libclc_alias_lib}
       DESTINATION ${LIBCLC_INSTALL_DIR}/${ARG_TRIPLE}/${a}
+      COMPONENT ${ARG_PARENT_TARGET}
     )
   endforeach( a )
 endfunction(add_libclc_builtin_set)



More information about the cfe-commits mailing list