From 8116f10312e5a6ad57f0e6c75a59a711ab118d1c Mon Sep 17 00:00:00 2001 From: "Kornev, Nikita" Date: Fri, 17 Oct 2025 19:17:01 +0200 Subject: [PATCH] [CMake] Improve libdevice install logic See: https://github.com/intel/llvm/issues/6937 This patch ensures that all required objects are built before installation. --- libdevice/cmake/modules/SYCLLibdevice.cmake | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libdevice/cmake/modules/SYCLLibdevice.cmake b/libdevice/cmake/modules/SYCLLibdevice.cmake index 8b7eaa3a723a4..ac23ef5dc14cb 100644 --- a/libdevice/cmake/modules/SYCLLibdevice.cmake +++ b/libdevice/cmake/modules/SYCLLibdevice.cmake @@ -898,3 +898,13 @@ foreach(ftype IN LISTS filetypes) COMPONENT libsycldevice) endforeach() +set(libsycldevice_build_targets) +foreach(filetype IN LISTS filetypes) + list(APPEND libsycldevice_build_targets libsycldevice-${filetype}) +endforeach() + +add_custom_target(install-libsycldevice + COMMAND ${CMAKE_COMMAND} -DCMAKE_INSTALL_COMPONENT=libsycldevice -P ${CMAKE_BINARY_DIR}/cmake_install.cmake + DEPENDS ${libsycldevice_build_targets} +) +add_dependencies(deploy-sycl-toolchain install-libsycldevice)