@@ -1518,6 +1518,18 @@ for host in "${ALL_HOSTS[@]}"; do
15181518 )
15191519 fi
15201520
1521+ if [[ " ${NATIVE_CLANG_TOOLS_PATH} " ]] ; then
1522+ CLANG_BIN=" ${NATIVE_CLANG_TOOLS_PATH} "
1523+ else
1524+ CLANG_BIN=" $( build_directory_bin ${LOCAL_HOST} llvm) "
1525+ fi
1526+
1527+ if [[ " ${NATIVE_SWIFT_TOOLS_PATH} " ]] ; then
1528+ SWIFTC_BIN=" ${NATIVE_SWIFT_TOOLS_PATH} /swiftc"
1529+ else
1530+ SWIFTC_BIN=" $( build_directory_bin ${LOCAL_HOST} swift) /swiftc"
1531+ fi
1532+
15211533 for product in " ${PRODUCTS[@]} " ; do
15221534 [[ $( should_execute_action " ${host} -${product/ _static} -build" ) ]] || continue
15231535
@@ -1954,7 +1966,7 @@ for host in "${ALL_HOSTS[@]}"; do
19541966 -DCMAKE_C_FLAGS=" $( llvm_c_flags ${host} ) "
19551967 -DCMAKE_CXX_FLAGS=" $( llvm_c_flags ${host} ) "
19561968 -DCMAKE_BUILD_TYPE:STRING=" ${LLDB_BUILD_TYPE} "
1957- -DLLDB_SWIFTC:PATH=" $( build_directory ${LOCAL_HOST} swift ) /bin/swiftc "
1969+ -DLLDB_SWIFTC:PATH=${SWIFTC_BIN}
19581970 -DLLDB_SWIFT_LIBS:PATH=" $( build_directory ${LOCAL_HOST} swift) /lib/swift"
19591971 -DCMAKE_INSTALL_PREFIX:PATH=" $( get_host_install_prefix ${host} ) "
19601972 -DLLDB_FRAMEWORK_INSTALL_DIR=" $( get_host_install_prefix ${host} ) ../System/Library/PrivateFrameworks"
@@ -2004,15 +2016,17 @@ for host in "${ALL_HOSTS[@]}"; do
20042016 " ${cmake_options[@]} "
20052017
20062018 -DCMAKE_BUILD_TYPE:STRING=" ${LLBUILD_BUILD_TYPE} "
2019+ -DCMAKE_C_COMPILER:PATH=" ${CLANG_BIN} /clang"
2020+ -DCMAKE_CXX_COMPILER:PATH=" ${CLANG_BIN} /clang++"
20072021 -DCMAKE_INSTALL_PREFIX:PATH=" $( get_host_install_prefix ${host} ) "
2008- -DCMAKE_Swift_COMPILER:PATH=" $( build_directory_bin ${LOCAL_HOST} swift ) /swiftc "
2022+ -DCMAKE_Swift_COMPILER:PATH=${SWIFTC_BIN}
20092023
20102024 -DLLBUILD_ENABLE_ASSERTIONS:BOOL=$( true_false " ${LLBUILD_ENABLE_ASSERTIONS} " )
20112025 -DLLBUILD_SUPPORT_BINDINGS:=Swift
20122026
20132027 -DLIT_EXECUTABLE:PATH=" ${LLVM_SOURCE_DIR} /utils/lit/lit.py"
20142028 -DFILECHECK_EXECUTABLE:PATH=" $( build_directory_bin ${LOCAL_HOST} llvm) /FileCheck"
2015- -DSWIFTC_EXECUTABLE:PATH=" $( build_directory_bin ${LOCAL_HOST} swift ) /swiftc "
2029+ -DSWIFTC_EXECUTABLE:PATH=${SWIFTC_BIN}
20162030 -DFOUNDATION_BUILD_DIR:PATH=" $( build_directory ${host} foundation) "
20172031 -DLIBDISPATCH_BUILD_DIR:PATH=" $( build_directory ${host} libdispatch) "
20182032 -DLIBDISPATCH_SOURCE_DIR:PATH=" ${LIBDISPATCH_SOURCE_DIR} "
@@ -2035,7 +2049,6 @@ for host in "${ALL_HOSTS[@]}"; do
20352049 fi
20362050 ;;
20372051 xctest)
2038- SWIFTC_BIN=" $( build_directory_bin ${LOCAL_HOST} swift) /swiftc"
20392052 XCTEST_BUILD_DIR=$( build_directory ${host} xctest)
20402053 FOUNDATION_BUILD_DIR=$( build_directory ${host} foundation)
20412054 SWIFT_BUILD_DIR=$( build_directory ${host} swift)
@@ -2073,14 +2086,12 @@ for host in "${ALL_HOSTS[@]}"; do
20732086 echo " Cleaning the XCTest build directory"
20742087 call rm -rf " ${XCTEST_BUILD_DIR} "
20752088
2076- LLVM_BIN=" $( build_directory_bin ${LOCAL_HOST} llvm) "
2077-
20782089 cmake_options=(
20792090 ${cmake_options[@]}
20802091 -DCMAKE_BUILD_TYPE:STRING=" ${XCTEST_BUILD_TYPE} "
2081- -DCMAKE_C_COMPILER:PATH=" ${LLVM_BIN } /clang"
2082- -DCMAKE_CXX_COMPILER:PATH=" ${LLVM_BIN } /clang++"
2083- -DCMAKE_Swift_COMPILER:PATH=" $( build_directory_bin ${LOCAL_HOST} swift ) /swiftc "
2092+ -DCMAKE_C_COMPILER:PATH=" ${CLANG_BIN } /clang"
2093+ -DCMAKE_CXX_COMPILER:PATH=" ${CLANG_BIN } /clang++"
2094+ -DCMAKE_Swift_COMPILER:PATH=${SWIFTC_BIN}
20842095 -DCMAKE_INSTALL_PREFIX:PATH=" $( get_host_install_prefix ${host} ) "
20852096 -DCMAKE_INSTALL_LIBDIR:PATH=" lib"
20862097
@@ -2091,7 +2102,7 @@ for host in "${ALL_HOSTS[@]}"; do
20912102 -DXCTEST_PATH_TO_LIBDISPATCH_SOURCE:PATH=${LIBDISPATCH_SOURCE_DIR}
20922103 -DXCTEST_PATH_TO_LIBDISPATCH_BUILD:PATH=$( build_directory ${host} libdispatch)
20932104 -DXCTEST_PATH_TO_FOUNDATION_BUILD:PATH=${FOUNDATION_BUILD_DIR}
2094- -DCMAKE_SWIFT_COMPILER:PATH=" $( build_directory_bin ${LOCAL_HOST} swift ) /swiftc "
2105+ -DCMAKE_SWIFT_COMPILER:PATH=${SWIFTC_BIN}
20952106 -DCMAKE_PREFIX_PATH:PATH=$( build_directory ${host} llvm)
20962107
20972108 -DENABLE_TESTING=YES
@@ -2106,9 +2117,6 @@ for host in "${ALL_HOSTS[@]}"; do
21062117 # is not yet built at this point.
21072118 XCTEST_BUILD_DIR=$( build_directory ${host} xctest)
21082119
2109- SWIFTC_BIN=" $( build_directory_bin ${LOCAL_HOST} swift) /swiftc"
2110- LLVM_BIN=" $( build_directory_bin ${LOCAL_HOST} llvm) "
2111-
21122120 if [[ ${host} == " macosx" * ]]; then
21132121 echo " Skipping Foundation on OS X -- use the Xcode project instead"
21142122 continue
@@ -2148,8 +2156,8 @@ for host in "${ALL_HOSTS[@]}"; do
21482156 cmake_options=(
21492157 ${cmake_options[@]}
21502158 -DCMAKE_BUILD_TYPE:STRING=${FOUNDATION_BUILD_TYPE}
2151- -DCMAKE_C_COMPILER:PATH=${LLVM_BIN } /clang
2152- -DCMAKE_CXX_COMPILER:PATH=${LLVM_BIN } /clang++
2159+ -DCMAKE_C_COMPILER:PATH=${CLANG_BIN } /clang
2160+ -DCMAKE_CXX_COMPILER:PATH=${CLANG_BIN } /clang++
21532161 -DCMAKE_SWIFT_COMPILER:PATH=${SWIFTC_BIN}
21542162 -DCMAKE_Swift_COMPILER:PATH=${SWIFTC_BIN}
21552163 -DCMAKE_INSTALL_PREFIX:PATH=$( get_host_install_prefix ${host} )
@@ -2171,8 +2179,6 @@ for host in "${ALL_HOSTS[@]}"; do
21712179 libdispatch|libdispatch_static)
21722180 LIBDISPATCH_BUILD_DIR=$( build_directory ${host} ${product} )
21732181 SWIFT_BUILD_PATH=" $( build_directory ${host} swift) "
2174- SWIFTC_BIN=" $( build_directory_bin ${LOCAL_HOST} swift) /swiftc"
2175- LLVM_BIN=" $( build_directory_bin ${LOCAL_HOST} llvm) "
21762182
21772183 case " ${host} " in
21782184 macosx-* )
@@ -2191,8 +2197,8 @@ for host in "${ALL_HOSTS[@]}"; do
21912197 -DENABLE_SWIFT=YES
21922198 ${cmake_options[@]}
21932199 -DCMAKE_BUILD_TYPE:STRING=" ${LIBDISPATCH_BUILD_TYPE} "
2194- -DCMAKE_C_COMPILER:PATH=" ${LLVM_BIN } /clang"
2195- -DCMAKE_CXX_COMPILER:PATH=" ${LLVM_BIN } /clang++"
2200+ -DCMAKE_C_COMPILER:PATH=" ${CLANG_BIN } /clang"
2201+ -DCMAKE_CXX_COMPILER:PATH=" ${CLANG_BIN } /clang++"
21962202 -DCMAKE_SWIFT_COMPILER:PATH=" ${SWIFTC_BIN} "
21972203 -DCMAKE_Swift_COMPILER:PATH=" ${SWIFTC_BIN} "
21982204 -DCMAKE_INSTALL_PREFIX:PATH=" $( get_host_install_prefix ${host} ) "
@@ -2399,6 +2405,18 @@ for host in "${ALL_HOSTS[@]}"; do
23992405
24002406 set_build_options_for_host $host
24012407
2408+ if [[ " ${NATIVE_CLANG_TOOLS_PATH} " ]] ; then
2409+ CLANG_BIN=" ${NATIVE_CLANG_TOOLS_PATH} "
2410+ else
2411+ CLANG_BIN=" $( build_directory_bin ${LOCAL_HOST} llvm) "
2412+ fi
2413+
2414+ if [[ " ${NATIVE_SWIFT_TOOLS_PATH} " ]] ; then
2415+ SWIFTC_BIN=" ${NATIVE_SWIFT_TOOLS_PATH} /swiftc"
2416+ else
2417+ SWIFTC_BIN=" $( build_directory_bin ${LOCAL_HOST} swift) /swiftc"
2418+ fi
2419+
24022420 # Run the tests for each product
24032421 for product in " ${PRODUCTS[@]} " ; do
24042422 # Check if we should perform this action.
@@ -2530,7 +2548,6 @@ for host in "${ALL_HOSTS[@]}"; do
25302548 fi
25312549
25322550 echo " --- Running tests for ${product} ---"
2533- SWIFTC_BIN=" $( build_directory_bin ${LOCAL_HOST} swift) /swiftc"
25342551 FOUNDATION_BUILD_DIR=$( build_directory ${host} foundation)
25352552 XCTEST_BUILD_DIR=$( build_directory ${host} xctest)
25362553 call " ${XCTEST_SOURCE_DIR} " /build_script.py test \
@@ -2583,16 +2600,12 @@ for host in "${ALL_HOSTS[@]}"; do
25832600 LIBICU_BUILD_ARGS=()
25842601 fi
25852602
2586-
2587- SWIFTC_BIN=" $( build_directory_bin ${LOCAL_HOST} swift) /swiftc"
2588- LLVM_BIN=" $( build_directory_bin ${LOCAL_HOST} llvm) "
2589-
25902603 # NOTE(compnerd) the time has come to enable tests now
25912604 cmake_options=(
25922605 ${cmake_options[@]}
25932606 -DCMAKE_BUILD_TYPE:STRING=${FOUNDATION_BUILD_TYPE}
2594- -DCMAKE_C_COMPILER:PATH=${LLVM_BIN } /clang
2595- -DCMAKE_CXX_COMPILER:PATH=${LLVM_BIN } /clang++
2607+ -DCMAKE_C_COMPILER:PATH=${CLANG_BIN } /clang
2608+ -DCMAKE_CXX_COMPILER:PATH=${CLANG_BIN } /clang++
25962609 -DCMAKE_Swift_COMPILER:PATH=${SWIFTC_BIN}
25972610 -DCMAKE_INSTALL_PREFIX:PATH=$( get_host_install_prefix ${host} )
25982611
@@ -2635,10 +2648,6 @@ for host in "${ALL_HOSTS[@]}"; do
26352648 continue
26362649 ;;
26372650 * )
2638- cmake_options=(
2639- ${cmake_options[@]}
2640- -DCMAKE_Swift_COMPILER:PATH=" $( build_directory_bin ${LOCAL_HOST} swift) /swiftc"
2641- )
26422651 results_targets=( " test" )
26432652 executable_target=" "
26442653 ;;
0 commit comments