Skip to content

[libclc] Change symlinks to copies on Windows #147759

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 9, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions libclc/cmake/modules/AddLibclc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -425,11 +425,17 @@ function(add_libclc_builtin_set)
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} )
endif()

foreach( a ${ARG_ALIASES} )
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 )
set( alias_suffix "${a}-${ARG_TRIPLE}.bc" )
add_custom_command(
OUTPUT ${LIBCLC_OUTPUT_LIBRARY_DIR}/${alias_suffix}
COMMAND ${CMAKE_COMMAND} -E create_symlink ${libclc_builtins_lib} ${LIBCLC_OUTPUT_LIBRARY_DIR}/${alias_suffix}
COMMAND ${CMAKE_COMMAND} -E ${LIBCLC_LINK_OR_COPY} ${libclc_builtins_lib} ${LIBCLC_OUTPUT_LIBRARY_DIR}/${alias_suffix}
DEPENDS prepare-${obj_suffix}
)
add_custom_target( alias-${alias_suffix} ALL
Expand Down
Loading