File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -730,6 +730,7 @@ set(SWIFT_INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR}/include")
730
730
set (SWIFT_RUNTIME_OUTPUT_INTDIR "${CMAKE_BINARY_DIR} /${CMAKE_CFG_INTDIR} /bin" )
731
731
set (SWIFT_LIBRARY_OUTPUT_INTDIR "${CMAKE_BINARY_DIR} /${CMAKE_CFG_INTDIR} /lib" )
732
732
if ("${SWIFT_NATIVE_SWIFT_TOOLS_PATH} " STREQUAL "" )
733
+ # This is the normal case. We are not cross-compiling.
733
734
set (SWIFT_NATIVE_SWIFT_TOOLS_PATH "${SWIFT_RUNTIME_OUTPUT_INTDIR} " )
734
735
set (SWIFT_EXEC_FOR_SWIFT_MODULES "${CMAKE_Swift_COMPILER} " )
735
736
elseif (BOOTSTRAPPING_MODE MATCHES "BOOTSTRAPPING.*" )
@@ -744,6 +745,12 @@ elseif(BOOTSTRAPPING_MODE MATCHES "BOOTSTRAPPING.*")
744
745
else ()
745
746
set (BOOTSTRAPPING_MODE "HOSTTOOLS" )
746
747
endif ()
748
+ elseif (BOOTSTRAPPING_MODE STREQUAL "HOSTTOOLS" )
749
+ # We are building using a pre-installed host toolchain but not bootstrapping
750
+ # the Swift modules. This happens when building using 'build-tooling-libs'
751
+ # where we haven't built a new Swift compiler. Use the Swift compiler from the
752
+ # pre-installed host toolchain to build the Swift modules.
753
+ set (SWIFT_EXEC_FOR_SWIFT_MODULES "${CMAKE_Swift_COMPILER} " )
747
754
endif ()
748
755
749
756
if (BOOTSTRAPPING_MODE MATCHES "HOSTTOOLS|.*-WITH-HOSTLIBS" )
Original file line number Diff line number Diff line change @@ -172,6 +172,7 @@ class Builder(object):
172
172
"-DSWIFT_HOST_VARIANT_SDK=" + host_sdk ,
173
173
"-DSWIFT_HOST_VARIANT_ARCH=" + self .arch ,
174
174
"-DCMAKE_Swift_COMPILER_TARGET=" + host_triple ,
175
+ "-DCMAKE_Swift_COMPILER=" + self .toolchain .swiftc ,
175
176
"-DCMAKE_C_FLAGS=" + llvm_c_flags ,
176
177
"-DCMAKE_CXX_FLAGS=" + llvm_c_flags ,
177
178
]
@@ -262,6 +263,13 @@ class Builder(object):
262
263
"-DCLANG_INCLUDE_TESTS=FALSE" ,
263
264
"-DSWIFT_INCLUDE_TESTS=FALSE" ,
264
265
]
266
+ cmake_args += [
267
+ "-DBOOTSTRAPPING_MODE=HOSTTOOLS" ,
268
+ "-DEXPERIMENTAL_STRING_PROCESSING_SOURCE_DIR=" +
269
+ os .path .join (SWIFT_SOURCE_ROOT ,
270
+ "swift-experimental-string-processing" ),
271
+ ]
272
+
265
273
llvm_src_path = os .path .join (SWIFT_SOURCE_ROOT , "llvm" ) \
266
274
if isSwiftContainedInLLVMProject \
267
275
else os .path .join (SWIFT_SOURCE_ROOT , "llvm-project" , "llvm" )
You can’t perform that action at this time.
0 commit comments