11cmake_minimum_required (VERSION 3.20.0)
22
33project ( libclc VERSION 0.2.0 LANGUAGES CXX C)
4+ set (LLVM_SUBPROJECT_TITLE "libclc" )
45
56set (CMAKE_CXX_STANDARD 17)
67
@@ -54,7 +55,10 @@ if( LIBCLC_STANDALONE_BUILD OR CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DI
5455 foreach ( tool IN ITEMS clang llvm-as llvm-link opt )
5556 find_program ( LLVM_TOOL_${tool} ${tool} PATHS ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH )
5657 add_executable ( libclc::${tool} IMPORTED GLOBAL )
57- set_target_properties ( libclc::${tool} PROPERTIES IMPORTED_LOCATION ${LLVM_TOOL_${tool} } )
58+ set_target_properties ( libclc::${tool} PROPERTIES
59+ IMPORTED_LOCATION ${LLVM_TOOL_${tool} }
60+ FOLDER "libclc/Tools"
61+ )
5862 endforeach ()
5963 endif ()
6064else ()
@@ -168,6 +172,7 @@ if( LIBCLC_STANDALONE_BUILD )
168172else ()
169173 add_llvm_utility( prepare_builtins utils/prepare-builtins.cpp )
170174endif ()
175+ set_target_properties ( prepare_builtins PROPERTIES FOLDER "libclc/Codegenning" )
171176target_compile_definitions ( prepare_builtins PRIVATE ${LLVM_VERSION_DEFINE} )
172177# These were not properly reported in early LLVM and we don't need them
173178target_compile_options ( prepare_builtins PRIVATE -fno-rtti -fno-exceptions )
@@ -225,12 +230,14 @@ add_custom_command(
225230 COMMAND ${Python3_EXECUTABLE} ${script_loc} > convert.cl
226231 DEPENDS ${script_loc} )
227232add_custom_target ( "generate_convert.cl" DEPENDS convert.cl )
233+ set_target_properties ( "generate_convert.cl" PROPERTIES FOLDER "libclc/Codegenning" )
228234
229235add_custom_command (
230236 OUTPUT clspv-convert.cl
231237 COMMAND ${Python3_EXECUTABLE} ${script_loc} --clspv > clspv-convert.cl
232238 DEPENDS ${script_loc} )
233239add_custom_target ( "clspv-generate_convert.cl" DEPENDS clspv-convert.cl )
240+ set_target_properties ( "clspv-generate_convert.cl" PROPERTIES FOLDER "libclc/Codegenning" )
234241
235242enable_testing ()
236243
@@ -394,6 +401,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
394401 DEPENDS ${builtins_link_lib}
395402 )
396403 add_custom_target ( "prepare-${spv_suffix} " ALL DEPENDS "${spv_suffix} " )
404+ set_target_properties ( "prepare-${spv_suffix} " PROPERTIES FOLDER "libclc/Codegenning" )
397405 install ( FILES ${CMAKE_CURRENT_BINARY_DIR} /${spv_suffix}
398406 DESTINATION "${CMAKE_INSTALL_DATADIR} /clc" )
399407 else ()
@@ -410,6 +418,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
410418 )
411419 set_target_properties ( ${builtins_opt_lib_tgt}
412420 PROPERTIES TARGET_FILE ${builtins_opt_lib_tgt} .bc
421+ FOLDER "libclc/Device IR/Opt"
413422 )
414423
415424 set ( builtins_opt_lib $<TARGET_PROPERTY:${builtins_opt_lib_tgt} ,TARGET_FILE> )
@@ -420,6 +429,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
420429 COMMAND prepare_builtins -o ${obj_suffix} ${builtins_opt_lib}
421430 DEPENDS ${builtins_opt_lib} prepare_builtins )
422431 add_custom_target ( prepare-${obj_suffix} ALL DEPENDS ${obj_suffix} )
432+ set_target_properties ( "prepare-${obj_suffix} " PROPERTIES FOLDER "libclc/Device IR/Prepare" )
423433
424434 # nvptx-- targets don't include workitem builtins
425435 if ( NOT clang_triple MATCHES ".*ptx.*--$" )
@@ -434,6 +444,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
434444 add_custom_target ( ${alias_suffix} ALL
435445 COMMAND ${CMAKE_COMMAND} -E create_symlink ${obj_suffix} ${alias_suffix}
436446 DEPENDS prepare-${obj_suffix} )
447+ set_target_properties ( "${alias_suffix} " PROPERTIES FOLDER "libclc/Device IR/Aliases" )
437448 install ( FILES ${CMAKE_CURRENT_BINARY_DIR} /${alias_suffix} DESTINATION "${CMAKE_INSTALL_DATADIR} /clc" )
438449 endforeach ( a )
439450 endif ()
0 commit comments