@@ -1522,6 +1522,18 @@ for host in "${ALL_HOSTS[@]}"; do
15221522 )
15231523 fi
15241524
1525+ if [[ " ${NATIVE_CLANG_TOOLS_PATH} " ]] ; then
1526+ CLANG_BIN=" ${NATIVE_CLANG_TOOLS_PATH} "
1527+ else
1528+ CLANG_BIN=" $( build_directory_bin ${LOCAL_HOST} llvm) "
1529+ fi
1530+
1531+ if [[ " ${NATIVE_SWIFT_TOOLS_PATH} " ]] ; then
1532+ SWIFTC_BIN=" ${NATIVE_SWIFT_TOOLS_PATH} /swiftc"
1533+ else
1534+ SWIFTC_BIN=" $( build_directory_bin ${LOCAL_HOST} swift) /swiftc"
1535+ fi
1536+
15251537 for product in " ${PRODUCTS[@]} " ; do
15261538 [[ $( should_execute_action " ${host} -${product/ _static} -build" ) ]] || continue
15271539
@@ -1958,7 +1970,7 @@ for host in "${ALL_HOSTS[@]}"; do
19581970 -DCMAKE_C_FLAGS=" $( llvm_c_flags ${host} ) "
19591971 -DCMAKE_CXX_FLAGS=" $( llvm_c_flags ${host} ) "
19601972 -DCMAKE_BUILD_TYPE:STRING=" ${LLDB_BUILD_TYPE} "
1961- -DLLDB_SWIFTC:PATH=" $( build_directory ${LOCAL_HOST} swift ) /bin/swiftc "
1973+ -DLLDB_SWIFTC:PATH=${SWIFTC_BIN}
19621974 -DLLDB_SWIFT_LIBS:PATH=" $( build_directory ${LOCAL_HOST} swift) /lib/swift"
19631975 -DCMAKE_INSTALL_PREFIX:PATH=" $( get_host_install_prefix ${host} ) "
19641976 -DLLDB_FRAMEWORK_INSTALL_DIR=" $( get_host_install_prefix ${host} ) ../System/Library/PrivateFrameworks"
@@ -2008,15 +2020,17 @@ for host in "${ALL_HOSTS[@]}"; do
20082020 " ${cmake_options[@]} "
20092021
20102022 -DCMAKE_BUILD_TYPE:STRING=" ${LLBUILD_BUILD_TYPE} "
2023+ -DCMAKE_C_COMPILER:PATH=" ${CLANG_BIN} /clang"
2024+ -DCMAKE_CXX_COMPILER:PATH=" ${CLANG_BIN} /clang++"
20112025 -DCMAKE_INSTALL_PREFIX:PATH=" $( get_host_install_prefix ${host} ) "
2012- -DCMAKE_Swift_COMPILER:PATH=" $( build_directory_bin ${LOCAL_HOST} swift ) /swiftc "
2026+ -DCMAKE_Swift_COMPILER:PATH=${SWIFTC_BIN}
20132027
20142028 -DLLBUILD_ENABLE_ASSERTIONS:BOOL=$( true_false " ${LLBUILD_ENABLE_ASSERTIONS} " )
20152029 -DLLBUILD_SUPPORT_BINDINGS:=Swift
20162030
20172031 -DLIT_EXECUTABLE:PATH=" ${LLVM_SOURCE_DIR} /utils/lit/lit.py"
20182032 -DFILECHECK_EXECUTABLE:PATH=" $( build_directory_bin ${LOCAL_HOST} llvm) /FileCheck"
2019- -DSWIFTC_EXECUTABLE:PATH=" $( build_directory_bin ${LOCAL_HOST} swift ) /swiftc "
2033+ -DSWIFTC_EXECUTABLE:PATH=${SWIFTC_BIN}
20202034 -DFOUNDATION_BUILD_DIR:PATH=" $( build_directory ${host} foundation) "
20212035 -DLIBDISPATCH_BUILD_DIR:PATH=" $( build_directory ${host} libdispatch) "
20222036 -DLIBDISPATCH_SOURCE_DIR:PATH=" ${LIBDISPATCH_SOURCE_DIR} "
@@ -2039,7 +2053,6 @@ for host in "${ALL_HOSTS[@]}"; do
20392053 fi
20402054 ;;
20412055 xctest)
2042- SWIFTC_BIN=" $( build_directory_bin ${LOCAL_HOST} swift) /swiftc"
20432056 XCTEST_BUILD_DIR=$( build_directory ${host} xctest)
20442057 FOUNDATION_BUILD_DIR=$( build_directory ${host} foundation)
20452058 SWIFT_BUILD_DIR=$( build_directory ${host} swift)
@@ -2077,14 +2090,12 @@ for host in "${ALL_HOSTS[@]}"; do
20772090 echo " Cleaning the XCTest build directory"
20782091 call rm -rf " ${XCTEST_BUILD_DIR} "
20792092
2080- LLVM_BIN=" $( build_directory_bin ${LOCAL_HOST} llvm) "
2081-
20822093 cmake_options=(
20832094 ${cmake_options[@]}
20842095 -DCMAKE_BUILD_TYPE:STRING=" ${XCTEST_BUILD_TYPE} "
2085- -DCMAKE_C_COMPILER:PATH=" ${LLVM_BIN } /clang"
2086- -DCMAKE_CXX_COMPILER:PATH=" ${LLVM_BIN } /clang++"
2087- -DCMAKE_Swift_COMPILER:PATH=" $( build_directory_bin ${LOCAL_HOST} swift ) /swiftc "
2096+ -DCMAKE_C_COMPILER:PATH=" ${CLANG_BIN } /clang"
2097+ -DCMAKE_CXX_COMPILER:PATH=" ${CLANG_BIN } /clang++"
2098+ -DCMAKE_Swift_COMPILER:PATH=${SWIFTC_BIN}
20882099 -DCMAKE_INSTALL_PREFIX:PATH=" $( get_host_install_prefix ${host} ) "
20892100 -DCMAKE_INSTALL_LIBDIR:PATH=" lib"
20902101
@@ -2095,7 +2106,7 @@ for host in "${ALL_HOSTS[@]}"; do
20952106 -DXCTEST_PATH_TO_LIBDISPATCH_SOURCE:PATH=${LIBDISPATCH_SOURCE_DIR}
20962107 -DXCTEST_PATH_TO_LIBDISPATCH_BUILD:PATH=$( build_directory ${host} libdispatch)
20972108 -DXCTEST_PATH_TO_FOUNDATION_BUILD:PATH=${FOUNDATION_BUILD_DIR}
2098- -DCMAKE_SWIFT_COMPILER:PATH=" $( build_directory_bin ${LOCAL_HOST} swift ) /swiftc "
2109+ -DCMAKE_SWIFT_COMPILER:PATH=${SWIFTC_BIN}
20992110 -DCMAKE_PREFIX_PATH:PATH=$( build_directory ${host} llvm)
21002111
21012112 -DENABLE_TESTING=YES
@@ -2110,9 +2121,6 @@ for host in "${ALL_HOSTS[@]}"; do
21102121 # is not yet built at this point.
21112122 XCTEST_BUILD_DIR=$( build_directory ${host} xctest)
21122123
2113- SWIFTC_BIN=" $( build_directory_bin ${LOCAL_HOST} swift) /swiftc"
2114- LLVM_BIN=" $( build_directory_bin ${LOCAL_HOST} llvm) "
2115-
21162124 if [[ ${host} == " macosx" * ]]; then
21172125 echo " Skipping Foundation on OS X -- use the Xcode project instead"
21182126 continue
@@ -2152,8 +2160,8 @@ for host in "${ALL_HOSTS[@]}"; do
21522160 cmake_options=(
21532161 ${cmake_options[@]}
21542162 -DCMAKE_BUILD_TYPE:STRING=${FOUNDATION_BUILD_TYPE}
2155- -DCMAKE_C_COMPILER:PATH=${LLVM_BIN } /clang
2156- -DCMAKE_CXX_COMPILER:PATH=${LLVM_BIN } /clang++
2163+ -DCMAKE_C_COMPILER:PATH=${CLANG_BIN } /clang
2164+ -DCMAKE_CXX_COMPILER:PATH=${CLANG_BIN } /clang++
21572165 -DCMAKE_SWIFT_COMPILER:PATH=${SWIFTC_BIN}
21582166 -DCMAKE_Swift_COMPILER:PATH=${SWIFTC_BIN}
21592167 -DCMAKE_INSTALL_PREFIX:PATH=$( get_host_install_prefix ${host} )
@@ -2175,8 +2183,6 @@ for host in "${ALL_HOSTS[@]}"; do
21752183 libdispatch|libdispatch_static)
21762184 LIBDISPATCH_BUILD_DIR=$( build_directory ${host} ${product} )
21772185 SWIFT_BUILD_PATH=" $( build_directory ${host} swift) "
2178- SWIFTC_BIN=" $( build_directory_bin ${LOCAL_HOST} swift) /swiftc"
2179- LLVM_BIN=" $( build_directory_bin ${LOCAL_HOST} llvm) "
21802186
21812187 case " ${host} " in
21822188 macosx-* )
@@ -2195,8 +2201,8 @@ for host in "${ALL_HOSTS[@]}"; do
21952201 -DENABLE_SWIFT=YES
21962202 ${cmake_options[@]}
21972203 -DCMAKE_BUILD_TYPE:STRING=" ${LIBDISPATCH_BUILD_TYPE} "
2198- -DCMAKE_C_COMPILER:PATH=" ${LLVM_BIN } /clang"
2199- -DCMAKE_CXX_COMPILER:PATH=" ${LLVM_BIN } /clang++"
2204+ -DCMAKE_C_COMPILER:PATH=" ${CLANG_BIN } /clang"
2205+ -DCMAKE_CXX_COMPILER:PATH=" ${CLANG_BIN } /clang++"
22002206 -DCMAKE_SWIFT_COMPILER:PATH=" ${SWIFTC_BIN} "
22012207 -DCMAKE_Swift_COMPILER:PATH=" ${SWIFTC_BIN} "
22022208 -DCMAKE_INSTALL_PREFIX:PATH=" $( get_host_install_prefix ${host} ) "
@@ -2403,6 +2409,18 @@ for host in "${ALL_HOSTS[@]}"; do
24032409
24042410 set_build_options_for_host $host
24052411
2412+ if [[ " ${NATIVE_CLANG_TOOLS_PATH} " ]] ; then
2413+ CLANG_BIN=" ${NATIVE_CLANG_TOOLS_PATH} "
2414+ else
2415+ CLANG_BIN=" $( build_directory_bin ${LOCAL_HOST} llvm) "
2416+ fi
2417+
2418+ if [[ " ${NATIVE_SWIFT_TOOLS_PATH} " ]] ; then
2419+ SWIFTC_BIN=" ${NATIVE_SWIFT_TOOLS_PATH} /swiftc"
2420+ else
2421+ SWIFTC_BIN=" $( build_directory_bin ${LOCAL_HOST} swift) /swiftc"
2422+ fi
2423+
24062424 # Run the tests for each product
24072425 for product in " ${PRODUCTS[@]} " ; do
24082426 # Check if we should perform this action.
@@ -2534,7 +2552,6 @@ for host in "${ALL_HOSTS[@]}"; do
25342552 fi
25352553
25362554 echo " --- Running tests for ${product} ---"
2537- SWIFTC_BIN=" $( build_directory_bin ${LOCAL_HOST} swift) /swiftc"
25382555 FOUNDATION_BUILD_DIR=$( build_directory ${host} foundation)
25392556 XCTEST_BUILD_DIR=$( build_directory ${host} xctest)
25402557 call " ${XCTEST_SOURCE_DIR} " /build_script.py test \
@@ -2587,16 +2604,12 @@ for host in "${ALL_HOSTS[@]}"; do
25872604 LIBICU_BUILD_ARGS=()
25882605 fi
25892606
2590-
2591- SWIFTC_BIN=" $( build_directory_bin ${LOCAL_HOST} swift) /swiftc"
2592- LLVM_BIN=" $( build_directory_bin ${LOCAL_HOST} llvm) "
2593-
25942607 # NOTE(compnerd) the time has come to enable tests now
25952608 cmake_options=(
25962609 ${cmake_options[@]}
25972610 -DCMAKE_BUILD_TYPE:STRING=${FOUNDATION_BUILD_TYPE}
2598- -DCMAKE_C_COMPILER:PATH=${LLVM_BIN } /clang
2599- -DCMAKE_CXX_COMPILER:PATH=${LLVM_BIN } /clang++
2611+ -DCMAKE_C_COMPILER:PATH=${CLANG_BIN } /clang
2612+ -DCMAKE_CXX_COMPILER:PATH=${CLANG_BIN } /clang++
26002613 -DCMAKE_Swift_COMPILER:PATH=${SWIFTC_BIN}
26012614 -DCMAKE_INSTALL_PREFIX:PATH=$( get_host_install_prefix ${host} )
26022615
@@ -2639,10 +2652,6 @@ for host in "${ALL_HOSTS[@]}"; do
26392652 continue
26402653 ;;
26412654 * )
2642- cmake_options=(
2643- ${cmake_options[@]}
2644- -DCMAKE_Swift_COMPILER:PATH=" $( build_directory_bin ${LOCAL_HOST} swift) /swiftc"
2645- )
26462655 results_targets=( " test" )
26472656 executable_target=" "
26482657 ;;
0 commit comments