Skip to content
Merged
Show file tree
Hide file tree
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
7 changes: 7 additions & 0 deletions libclc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ set( LIBCLC_TARGETS_TO_BUILD "all"

option( ENABLE_RUNTIME_SUBNORMAL "Enable runtime linking of subnormal support." OFF )

# Top level target used to build all Libclc libraries.
add_custom_target( libclc ALL )

add_custom_target( libclc-opencl-builtins COMMENT "Build libclc OpenCL builtins" )
add_dependencies( libclc libclc-opencl-builtins )

if( LIBCLC_STANDALONE_BUILD OR CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
# Out-of-tree configuration
set( LIBCLC_STANDALONE_BUILD TRUE )
Expand Down Expand Up @@ -463,6 +469,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
LIB_FILES ${opencl_lib_files}
GEN_FILES ${opencl_gen_files}
ALIASES ${${d}_aliases}
PARENT_TARGET libclc-opencl-builtins
# Link in the CLC builtins and internalize their symbols
INTERNAL_LINK_DEPENDENCIES builtins.link.clc-${arch_suffix}
)
Expand Down
8 changes: 7 additions & 1 deletion libclc/cmake/modules/AddLibclc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ endfunction()
# libclc architecture/triple suffix
# * TRIPLE <string>
# Triple used to compile
# * PARENT_TARGET <string>
# Target into which to group the target builtins
#
# Optional Arguments:
# * CLC_INTERNAL
Expand All @@ -229,7 +231,7 @@ endfunction()
function(add_libclc_builtin_set)
cmake_parse_arguments(ARG
"CLC_INTERNAL"
"ARCH;TRIPLE;ARCH_SUFFIX"
"ARCH;TRIPLE;ARCH_SUFFIX;PARENT_TARGET"
"LIB_FILES;GEN_FILES;COMPILE_FLAGS;OPT_FLAGS;ALIASES;INTERNAL_LINK_DEPENDENCIES"
${ARGN}
)
Expand Down Expand Up @@ -403,6 +405,9 @@ function(add_libclc_builtin_set)
add_custom_target( prepare-${ARG_TRIPLE} ALL )
endif()
add_dependencies( prepare-${ARG_TRIPLE} prepare-${obj_suffix} )
# Add dependency to top-level pseudo target to ease making other
# targets dependent on libclc.
add_dependencies( ${ARG_PARENT_TARGET} prepare-${ARG_TRIPLE} )

install(
FILES ${libclc_builtins_lib}
Expand Down Expand Up @@ -445,6 +450,7 @@ function(add_libclc_builtin_set)
add_custom_target( alias-${alias_suffix} ALL
DEPENDS ${LIBCLC_OUTPUT_LIBRARY_DIR}/${alias_suffix}
)
add_dependencies( ${ARG_PARENT_TARGET} alias-${alias_suffix} )
set_target_properties( alias-${alias_suffix}
PROPERTIES FOLDER "libclc/Device IR/Aliases"
)
Expand Down
Loading