File tree Expand file tree Collapse file tree 5 files changed +14
-12
lines changed Expand file tree Collapse file tree 5 files changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -487,6 +487,14 @@ else()
487
487
set (SWIFT_CROSS_COMPILING TRUE )
488
488
endif ()
489
489
490
+ # Check if a prebuilt clang path was passed in, as this variable will be
491
+ # assigned if not, in SwiftSharedCMakeConfig.
492
+ if ("${SWIFT_NATIVE_CLANG_TOOLS_PATH} " STREQUAL "" )
493
+ set (SWIFT_PREBUILT_CLANG FALSE )
494
+ else ()
495
+ set (SWIFT_PREBUILT_CLANG TRUE )
496
+ endif ()
497
+
490
498
include (SwiftSharedCMakeConfig )
491
499
492
500
# NOTE: We include this before SwiftComponents as it relies on some LLVM CMake
Original file line number Diff line number Diff line change @@ -1669,7 +1669,8 @@ function(add_swift_target_library name)
1669
1669
list (APPEND SWIFTLIB_SWIFT_COMPILE_FLAGS "-warn-implicit-overrides" )
1670
1670
endif ()
1671
1671
1672
- if (NOT SWIFT_BUILD_RUNTIME_WITH_HOST_COMPILER AND NOT BUILD_STANDALONE )
1672
+ if (NOT SWIFT_BUILD_RUNTIME_WITH_HOST_COMPILER AND NOT BUILD_STANDALONE AND
1673
+ NOT SWIFT_PREBUILT_CLANG )
1673
1674
list (APPEND SWIFTLIB_DEPENDS clang )
1674
1675
endif ()
1675
1676
Original file line number Diff line number Diff line change @@ -111,7 +111,8 @@ endif()
111
111
# First extract the "version" used for Clang's resource directory.
112
112
string (REGEX MATCH "[0-9]+\\ .[0-9]+(\\ .[0-9]+)?" CLANG_VERSION
113
113
"${LLVM_PACKAGE_VERSION} " )
114
- if (NOT SWIFT_INCLUDE_TOOLS AND SWIFT_BUILD_RUNTIME_WITH_HOST_COMPILER )
114
+ if (NOT SWIFT_INCLUDE_TOOLS AND
115
+ (SWIFT_BUILD_RUNTIME_WITH_HOST_COMPILER OR SWIFT_PREBUILT_CLANG ))
115
116
if (SWIFT_COMPILER_IS_MSVC_LIKE )
116
117
execute_process (COMMAND ${CMAKE_C_COMPILER} /clang:-print-resource-dir
117
118
OUTPUT_VARIABLE clang_headers_location
Original file line number Diff line number Diff line change @@ -2283,10 +2283,9 @@ skip-build-cmark
2283
2283
skip-build-benchmarks
2284
2284
skip-test-cmark
2285
2285
2286
- # This triggers the stdlib standalone build: Don 't build tools ( the compiler),
2287
- # assume we are working with the host compiler.
2286
+ # This triggers the stdlib standalone build: don 't build the native tools from
2287
+ # scratch, ie the compiler.
2288
2288
build-swift-tools =0
2289
- build-runtime-with-host-compiler =1
2290
2289
2291
2290
# Then set the paths to our native tools. If compiling against a toolchain,
2292
2291
# these should all be the ./usr/bin directory.
Original file line number Diff line number Diff line change @@ -1485,13 +1485,6 @@ for host in "${ALL_HOSTS[@]}"; do
1485
1485
fi
1486
1486
fi
1487
1487
1488
- if [[ " ${NATIVE_CLANG_TOOLS_PATH} " ]] ; then
1489
- common_cmake_options_host+=(
1490
- -DCMAKE_C_COMPILER=" ${NATIVE_CLANG_TOOLS_PATH} /clang"
1491
- -DCMAKE_CXX_COMPILER=" ${NATIVE_CLANG_TOOLS_PATH} /clang++"
1492
- )
1493
- fi
1494
-
1495
1488
llvm_cmake_options=(
1496
1489
" ${llvm_cmake_options[@]} "
1497
1490
-DCMAKE_INSTALL_PREFIX:PATH=" $( get_host_install_prefix ${host} ) "
You can’t perform that action at this time.
0 commit comments