https://github.com/wenju-he updated 
https://github.com/llvm/llvm-project/pull/152703

>From be71d635d2de980797be595c4f35f307c703bc96 Mon Sep 17 00:00:00 2001
From: Wenju He <wenju...@intel.com>
Date: Fri, 8 Aug 2025 05:59:54 -0700
Subject: [PATCH 1/2] [libclc] Fix libclc install on Windows when MSVC
 generator is used

Fix a regression of df7473673214.

cmake MSVC generator is multiple configurations. Build type is not known
at configure time and CMAKE_CFG_INTDIR is evaluated to $(Configuration)
at configure time. libclc install fails since $(Configuration) in bitcode
file path is unresolved in libclc/cmake_install.cmake at install time.

We need a solution that resolves libclc bitcode file path at install
time. This PR fixes the issue using CMAKE_INSTALL_CONFIG_NAME which can
be evaluated at install time. This is the same solution as in
https://reviews.llvm.org/D76827
---
 libclc/cmake/modules/AddLibclc.cmake | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/libclc/cmake/modules/AddLibclc.cmake 
b/libclc/cmake/modules/AddLibclc.cmake
index 91d49610eee01..892d151977f83 100644
--- a/libclc/cmake/modules/AddLibclc.cmake
+++ b/libclc/cmake/modules/AddLibclc.cmake
@@ -425,8 +425,14 @@ function(add_libclc_builtin_set)
   # targets dependent on libclc.
   add_dependencies( ${ARG_PARENT_TARGET} prepare-${ARG_TRIPLE} )
 
+  if( NOT CMAKE_CFG_INTDIR STREQUAL  "." )
+    string( REPLACE ${CMAKE_CFG_INTDIR} "\$\{CMAKE_INSTALL_CONFIG_NAME\}"
+            libclc_builtins_lib_install ${libclc_builtins_lib} )
+  else()
+    set( libclc_builtins_lib_install ${libclc_builtins_lib} )
+  endif()
   install(
-    FILES ${libclc_builtins_lib}
+    FILES ${libclc_builtins_lib_install}
     DESTINATION "${CMAKE_INSTALL_DATADIR}/clc"
   )
 

>From 26de657925c40fa5072aa4e549e395bad52eefd5 Mon Sep 17 00:00:00 2001
From: Wenju He <wenju...@intel.com>
Date: Fri, 8 Aug 2025 07:02:59 -0700
Subject: [PATCH 2/2] remove a space

---
 libclc/cmake/modules/AddLibclc.cmake | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libclc/cmake/modules/AddLibclc.cmake 
b/libclc/cmake/modules/AddLibclc.cmake
index 892d151977f83..5a068c8e34a5f 100644
--- a/libclc/cmake/modules/AddLibclc.cmake
+++ b/libclc/cmake/modules/AddLibclc.cmake
@@ -425,7 +425,7 @@ function(add_libclc_builtin_set)
   # targets dependent on libclc.
   add_dependencies( ${ARG_PARENT_TARGET} prepare-${ARG_TRIPLE} )
 
-  if( NOT CMAKE_CFG_INTDIR STREQUAL  "." )
+  if( NOT CMAKE_CFG_INTDIR STREQUAL "." )
     string( REPLACE ${CMAKE_CFG_INTDIR} "\$\{CMAKE_INSTALL_CONFIG_NAME\}"
             libclc_builtins_lib_install ${libclc_builtins_lib} )
   else()

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to