1
1
cmake_minimum_required (VERSION 3.20.0 )
2
2
3
3
project ( libclc VERSION 0.2.0 LANGUAGES CXX C )
4
+ set (LLVM_SUBPROJECT_TITLE "libclc" )
4
5
5
6
set (CMAKE_CXX_STANDARD 17 )
6
7
@@ -54,7 +55,10 @@ if( LIBCLC_STANDALONE_BUILD OR CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DI
54
55
foreach ( tool IN ITEMS clang llvm-as llvm-link opt )
55
56
find_program ( LLVM_TOOL_${tool} ${tool} PATHS ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH )
56
57
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
+ )
58
62
endforeach ()
59
63
endif ()
60
64
else ()
@@ -168,6 +172,7 @@ if( LIBCLC_STANDALONE_BUILD )
168
172
else ()
169
173
add_llvm_utility ( prepare_builtins utils/prepare-builtins.cpp )
170
174
endif ()
175
+ set_target_properties ( prepare_builtins PROPERTIES FOLDER "libclc/Codegenning" )
171
176
target_compile_definitions ( prepare_builtins PRIVATE ${LLVM_VERSION_DEFINE} )
172
177
# These were not properly reported in early LLVM and we don't need them
173
178
target_compile_options ( prepare_builtins PRIVATE -fno-rtti -fno-exceptions )
@@ -225,12 +230,14 @@ add_custom_command(
225
230
COMMAND ${Python3_EXECUTABLE} ${script_loc} > convert.cl
226
231
DEPENDS ${script_loc} )
227
232
add_custom_target ( "generate_convert.cl" DEPENDS convert.cl )
233
+ set_target_properties ( "generate_convert.cl" PROPERTIES FOLDER "libclc/Codegenning" )
228
234
229
235
add_custom_command (
230
236
OUTPUT clspv-convert.cl
231
237
COMMAND ${Python3_EXECUTABLE} ${script_loc} --clspv > clspv-convert.cl
232
238
DEPENDS ${script_loc} )
233
239
add_custom_target ( "clspv-generate_convert.cl" DEPENDS clspv-convert.cl )
240
+ set_target_properties ( "clspv-generate_convert.cl" PROPERTIES FOLDER "libclc/Codegenning" )
234
241
235
242
enable_testing ()
236
243
@@ -394,6 +401,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
394
401
DEPENDS ${builtins_link_lib}
395
402
)
396
403
add_custom_target ( "prepare-${spv_suffix} " ALL DEPENDS "${spv_suffix} " )
404
+ set_target_properties ( "prepare-${spv_suffix} " PROPERTIES FOLDER "libclc/Codegenning" )
397
405
install ( FILES ${CMAKE_CURRENT_BINARY_DIR} /${spv_suffix}
398
406
DESTINATION "${CMAKE_INSTALL_DATADIR} /clc" )
399
407
else ()
@@ -410,6 +418,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
410
418
)
411
419
set_target_properties ( ${builtins_opt_lib_tgt}
412
420
PROPERTIES TARGET_FILE ${builtins_opt_lib_tgt} .bc
421
+ FOLDER "libclc/Device IR/Opt"
413
422
)
414
423
415
424
set ( builtins_opt_lib $< TARGET_PROPERTY:${builtins_opt_lib_tgt} ,TARGET_FILE> )
@@ -420,6 +429,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
420
429
COMMAND prepare_builtins -o ${obj_suffix} ${builtins_opt_lib}
421
430
DEPENDS ${builtins_opt_lib} prepare_builtins )
422
431
add_custom_target ( prepare-${obj_suffix} ALL DEPENDS ${obj_suffix} )
432
+ set_target_properties ( "prepare-${obj_suffix} " PROPERTIES FOLDER "libclc/Device IR/Prepare" )
423
433
424
434
# nvptx-- targets don't include workitem builtins
425
435
if ( NOT clang_triple MATCHES ".*ptx.*--$" )
@@ -434,6 +444,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
434
444
add_custom_target ( ${alias_suffix} ALL
435
445
COMMAND ${CMAKE_COMMAND} -E create_symlink ${obj_suffix} ${alias_suffix}
436
446
DEPENDS prepare-${obj_suffix} )
447
+ set_target_properties ( "${alias_suffix} " PROPERTIES FOLDER "libclc/Device IR/Aliases" )
437
448
install ( FILES ${CMAKE_CURRENT_BINARY_DIR} /${alias_suffix} DESTINATION "${CMAKE_INSTALL_DATADIR} /clc" )
438
449
endforeach ( a )
439
450
endif ()
0 commit comments