@@ -366,7 +366,10 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
366366 COMMAND ${LLVM_SPIRV} ${spvflags} -o ${spv_suffix} ${builtins_link_lib}
367367 DEPENDS ${builtins_link_lib}
368368 )
369- add_custom_target ( "prepare-${spv_suffix} " ALL DEPENDS "${spv_suffix} " )
369+ add_custom_target ( prepare-${arch_suffix} ALL DEPENDS ${spv_suffix} )
370+ set_target_properties ( prepare-${arch_suffix}
371+ PROPERTIES TARGET_FILE ${spv_suffix}
372+ )
370373 install ( FILES ${CMAKE_CURRENT_BINARY_DIR} /${spv_suffix}
371374 DESTINATION "${CMAKE_INSTALL_DATADIR} /clc" )
372375 else ()
@@ -392,7 +395,10 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
392395 add_custom_command ( OUTPUT ${obj_suffix}
393396 COMMAND prepare_builtins -o ${obj_suffix} ${builtins_opt_lib}
394397 DEPENDS ${builtins_opt_lib} prepare_builtins )
395- add_custom_target ( prepare-${obj_suffix} ALL DEPENDS ${obj_suffix} )
398+ add_custom_target ( prepare-${arch_suffix} ALL DEPENDS ${obj_suffix} )
399+ set_target_properties ( prepare-${arch_suffix}
400+ PROPERTIES TARGET_FILE ${obj_suffix}
401+ )
396402
397403 # nvptx-- targets don't include workitem builtins
398404 if ( NOT clang_triple MATCHES ".*ptx.*--$" )
@@ -406,9 +412,13 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
406412 set ( alias_suffix "${a} -${clang_triple} .bc" )
407413 add_custom_target ( ${alias_suffix} ALL
408414 COMMAND ${CMAKE_COMMAND} -E create_symlink ${obj_suffix} ${alias_suffix}
409- DEPENDS prepare-${obj_suffix } )
415+ DEPENDS prepare-${arch_suffix } )
410416 install ( FILES ${CMAKE_CURRENT_BINARY_DIR} /${alias_suffix} DESTINATION "${CMAKE_INSTALL_DATADIR} /clc" )
411417 endforeach ( a )
412418 endif ()
413419 endforeach ( d )
414420endforeach ( t )
421+
422+ if ( NOT LIBCLC_STANDALONE_BUILD )
423+ add_subdirectory ( test )
424+ endif ()
0 commit comments