Skip to content

Commit

Permalink
Reland "[libclc] Create aliases with custom_command (llvm#115885)"
Browse files Browse the repository at this point in the history
This relands commit 2c98031 after
fixing an issue.
  • Loading branch information
frasercrmck committed Nov 13, 2024
1 parent c7df106 commit beb5805
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions libclc/cmake/modules/AddLibclc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -355,11 +355,14 @@ function(add_libclc_builtin_set)
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${obj_suffix} DESTINATION "${CMAKE_INSTALL_DATADIR}/clc" )
foreach( a ${ARG_ALIASES} )
set( alias_suffix "${a}-${ARG_TRIPLE}.bc" )
add_custom_target( ${alias_suffix} ALL
add_custom_command(
OUTPUT ${alias_suffix}
COMMAND ${CMAKE_COMMAND} -E create_symlink ${obj_suffix} ${alias_suffix}
DEPENDS prepare-${obj_suffix} )
set_target_properties( "${alias_suffix}" PROPERTIES FOLDER "libclc/Device IR/Aliases" )
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${alias_suffix} DESTINATION "${CMAKE_INSTALL_DATADIR}/clc" )
add_custom_target( alias-${alias_suffix} ALL DEPENDS ${alias_suffix} )
set_target_properties( alias-${alias_suffix} PROPERTIES FOLDER "libclc/Device IR/Aliases" )
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${alias_suffix}
DESTINATION "${CMAKE_INSTALL_DATADIR}/clc" )
endforeach( a )
endfunction(add_libclc_builtin_set)

Expand Down

0 comments on commit beb5805

Please sign in to comment.