From ebe3c24ddd1f8bd53886a0d30914334eb87381c5 Mon Sep 17 00:00:00 2001 From: Andrei Elovikov Date: Fri, 7 Nov 2025 11:14:05 -0800 Subject: [PATCH] [SYCL RTC][CMake] `libdevice` isn't an optional dependency --- sycl-jit/jit-compiler/CMakeLists.txt | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/sycl-jit/jit-compiler/CMakeLists.txt b/sycl-jit/jit-compiler/CMakeLists.txt index dab40ee9eed58..2c8e03346e90b 100644 --- a/sycl-jit/jit-compiler/CMakeLists.txt +++ b/sycl-jit/jit-compiler/CMakeLists.txt @@ -9,14 +9,21 @@ else() set(SYCL_JIT_VIRTUAL_TOOLCHAIN_ROOT "/sycl-jit-toolchain/") endif() -set(SYCL_JIT_RESOURCE_INSTALL_COMPONENTS sycl-headers OpenCL-Headers clang-resource-headers) -if ("libclc" IN_LIST LLVM_ENABLE_PROJECTS) - list(APPEND SYCL_JIT_RESOURCE_INSTALL_COMPONENTS libspirv-builtins) +if (NOT "libdevice" IN_LIST LLVM_ENABLE_PROJECTS) + message(FATAL_ERROR "libdevice is required for jit-compiler but not present in LLVM_ENABLE_PROJECTS") endif() -if ("libdevice" IN_LIST LLVM_ENABLE_PROJECTS) - list(APPEND SYCL_JIT_RESOURCE_INSTALL_COMPONENTS libsycldevice) +set(SYCL_JIT_RESOURCE_INSTALL_COMPONENTS + sycl-headers + OpenCL-Headers + clang-resource-headers + libsycldevice) + +if ("libclc" IN_LIST LLVM_ENABLE_PROJECTS) + # If some targets required `libclc` then we should embed it for the + # `sycl-jit`. + list(APPEND SYCL_JIT_RESOURCE_INSTALL_COMPONENTS libspirv-builtins) endif() set(SYCL_JIT_RESOURCE_INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/rtc-resources-install)