Index: cmake/modules/LLVMExternalProjectUtils.cmake =================================================================== --- cmake/modules/LLVMExternalProjectUtils.cmake +++ cmake/modules/LLVMExternalProjectUtils.cmake @@ -196,11 +196,14 @@ # Add top-level targets foreach(target ${ARG_EXTRA_TARGETS}) - string(REPLACE ":" ";" target_list ${target}) - list(GET target_list 0 target) - list(LENGTH target_list target_list_len) - if(${target_list_len} GREATER 1) - list(GET target_list 1 target_name) + if(DEFINED ${target}) + list(LENGTH ${target} target_len) + if(${target_len} GREATER 1) + list(GET ${target} 1 target_name) + else() + list(GET ${target} 0 target_name) + endif() + list(GET ${target} 0 target) else() set(target_name "${target}") endif() Index: runtimes/CMakeLists.txt =================================================================== --- runtimes/CMakeLists.txt +++ runtimes/CMakeLists.txt @@ -346,11 +346,12 @@ endif() foreach(runtime_name ${runtime_names}) - list(APPEND ${name}_extra_targets - "${runtime_name}:${runtime_name}-${name}" - "install-${runtime_name}:install-${runtime_name}-${name}") + set(${name}_${runtime_name} ${runtime_name} ${runtime_name}-${name}) + set(${name}_install_${runtime_name} install-${runtime_name} install-${runtime_name}-${name}) + list(APPEND ${name}_extra_targets ${name}_${runtime_name} ${name}_install_${runtime_name}) if(LLVM_INCLUDE_TESTS) - list(APPEND ${name}_test_targets "check-${runtime_name}:check-${runtime_name}-${name}") + set(${name}_check_${runtime_name} check-${runtime_name} check-${runtime_name}-${name}) + list(APPEND ${name}_test_targets ${name}_check_${runtime_name}) endif() endforeach() @@ -359,11 +360,12 @@ endforeach() if(LLVM_INCLUDE_TESTS) - list(APPEND ${name}_test_targets - "runtimes-test-depends:runtimes-test-depends-${name}" - "check-runtimes:check-runtimes-${name}") + set(${name}_runtime_test_depends runtimes-test-depends runtimes-test-depends-${name}) + set(${name}_check_runtimes check-runtimes check-runtimes-${name}) + list(APPEND ${name}_test_targets ${name}_runtime_test_depends ${name}_check_runtimes) foreach(target_name IN LISTS SUB_CHECK_TARGETS) - list(APPEND ${name}_test_targets "${target_name}:${target_name}-${name}") + set(${name}_${target_name} ${target_name} ${target_name}-${name}) + list(APPEND ${name}_test_targets ${name}_${target_name}) list(APPEND test_targets "${target_name}-${name}") endforeach() set(test_targets "${test_targets}" PARENT_SCOPE)