[libclc] [libclc] Fix installed symlinks to be relative again (PR #149728)

Wenju He via cfe-commits cfe-commits at lists.llvm.org
Sun Jul 20 18:32:44 PDT 2025


================
@@ -425,17 +425,21 @@ function(add_libclc_builtin_set)
       WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} )
   endif()
 
-  if(CMAKE_HOST_UNIX OR LLVM_USE_SYMLINKS)
-    set(LIBCLC_LINK_OR_COPY create_symlink)
-  else()
-    set(LIBCLC_LINK_OR_COPY copy)
-  endif()
-
   foreach( a IN LISTS ARG_ALIASES )
+    if(CMAKE_HOST_UNIX OR LLVM_USE_SYMLINKS)
+      cmake_path(RELATIVE_PATH libclc_builtins_lib
+        BASE_DIRECTORY ${LIBCLC_OUTPUT_LIBRARY_DIR}
----------------
wenju-he wrote:

It seems libclc_builtins_lib is always located in LIBCLC_OUTPUT_LIBRARY_DIR, so here probably we only need to set LIBCLC_LINK_OR_COPY_SOURCE to be file basename part of libclc_builtins_lib.

https://github.com/llvm/llvm-project/pull/149728


More information about the cfe-commits mailing list