Skip to content

Commit ee95f3f

Browse files
authored
Merge pull request #40068 from eeckstein/fix-libswift-bootstrapping
libswift: fixes and improvements for the bootstrapping build
2 parents 6d33683 + e30688d commit ee95f3f

File tree

11 files changed

+97
-78
lines changed

11 files changed

+97
-78
lines changed

CMakeLists.txt

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,9 @@ cmake_dependent_option(LIBSWIFT_BUILD_MODE "How to build libswift. Possible valu
204204
HOSTTOOLS: libswift is built with a pre-installed toolchain
205205
BOOTSTRAPPING: libswift is built with a 2-stage bootstrapping process
206206
BOOTSTRAPPING-WITH-HOSTLIBS: libswift is built with a 2-stage bootstrapping process,
207-
but the compiler links against the host system swift libs (macOS only)"
207+
but the compiler links against the host system swift libs (macOS only)
208+
CROSSCOMPILE-WITH-HOSTLIBS: libswift is built with a bootstrapping-with-hostlibs compiled
209+
compiler, provided in `SWIFT_NATIVE_SWIFT_TOOLS_PATH`"
208210
OFF "NOT CMAKE_GENERATOR STREQUAL \"Xcode\"" OFF)
209211

210212
# The following only works with the Ninja generator in CMake >= 3.0.
@@ -612,15 +614,19 @@ set(SWIFT_LIBRARY_OUTPUT_INTDIR "${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib")
612614
if("${SWIFT_NATIVE_SWIFT_TOOLS_PATH}" STREQUAL "")
613615
set(SWIFT_NATIVE_SWIFT_TOOLS_PATH "${SWIFT_RUNTIME_OUTPUT_INTDIR}")
614616
set(SWIFT_EXEC_FOR_LIBSWIFT "${CMAKE_Swift_COMPILER}")
615-
elseif(LIBSWIFT_BUILD_MODE STREQUAL "BOOTSTRAPPING" OR LIBSWIFT_BUILD_MODE STREQUAL "BOOTSTRAPPING-WITH-HOSTLIBS")
617+
elseif(LIBSWIFT_BUILD_MODE MATCHES "BOOTSTRAPPING.*")
616618
# If cross-compiling we don't have to bootstrap. We can just use the previously
617619
# built native swiftc to build libswift.
618-
message(STATUS "Building libswift with native host tools instead of bootstrapping")
619-
set(LIBSWIFT_BUILD_MODE "HOSTTOOLS")
620+
message(STATUS "Building libswift with previously built tools instead of bootstrapping")
620621
set(SWIFT_EXEC_FOR_LIBSWIFT "${SWIFT_NATIVE_SWIFT_TOOLS_PATH}/swiftc")
622+
if(LIBSWIFT_BUILD_MODE STREQUAL "BOOTSTRAPPING-WITH-HOSTLIBS")
623+
set(LIBSWIFT_BUILD_MODE "CROSSCOMPILE-WITH-HOSTLIBS")
624+
else()
625+
set(LIBSWIFT_BUILD_MODE "HOSTTOOLS")
626+
endif()
621627
endif()
622628

623-
if(LIBSWIFT_BUILD_MODE STREQUAL "HOSTTOOLS" OR LIBSWIFT_BUILD_MODE STREQUAL "BOOTSTRAPPING-WITH-HOSTLIBS")
629+
if(LIBSWIFT_BUILD_MODE MATCHES "HOSTTOOLS|.*-WITH-HOSTLIBS")
624630
if(SWIFT_ENABLE_ARRAY_COW_CHECKS)
625631
message(STATUS "array COW checks disabled when building libswift with host libraries")
626632
set(SWIFT_ENABLE_ARRAY_COW_CHECKS FALSE)

cmake/modules/AddSwift.cmake

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -747,6 +747,13 @@ function(add_libswift name)
747747
set(deployment_version "10.15") # TODO: once #38675 lands, replace this with
748748
# set(deployment_version "${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_DEPLOYMENT_VERSION}")
749749
set(sdk_option "-sdk" "${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_ARCH_${SWIFT_HOST_VARIANT_ARCH}_PATH}")
750+
if(${LIBSWIFT_BUILD_MODE} STREQUAL "CROSSCOMPILE-WITH-HOSTLIBS")
751+
# Let the cross-compiled compile don't pick up the compiled stdlib by providing
752+
# an (almost) empty resource dir.
753+
# The compiler will instead pick up the stdlib from the SDK.
754+
get_filename_component(swift_exec_bin_dir ${ALS_SWIFT_EXEC} DIRECTORY)
755+
set(sdk_option ${sdk_option} "-resource-dir" "${swift_exec_bin_dir}/../bootstrapping0/lib/swift")
756+
endif()
750757
endif()
751758
get_versioned_target_triple(target ${SWIFT_HOST_VARIANT_SDK}
752759
${SWIFT_HOST_VARIANT_ARCH} "${deployment_version}")
@@ -878,6 +885,7 @@ function(add_swift_host_tool executable)
878885
# Please add each rpath separately below to the list, explaining why you are
879886
# adding it.
880887
set(RPATH_LIST)
888+
set(sdk_dir "${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_ARCH_${SWIFT_HOST_VARIANT_ARCH}_PATH}/usr/lib/swift")
881889
882890
# If we found a swift compiler and are going to use swift code in swift
883891
# host side tools but link with clang, add the appropriate -L paths so we
@@ -890,9 +898,24 @@ function(add_swift_host_tool executable)
890898
get_filename_component(TOOLCHAIN_LIB_DIR "${TOOLCHAIN_BIN_DIR}/../lib/swift/macosx" ABSOLUTE)
891899
target_link_directories(${executable} PUBLIC ${TOOLCHAIN_LIB_DIR})
892900
893-
# Add in the SDK directory for the host platform.
894-
target_link_directories(${executable} PRIVATE
895-
${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_ARCH_${SWIFT_HOST_VARIANT_ARCH}_PATH}/usr/lib/swift)
901+
# Add the SDK directory for the host platform.
902+
target_link_directories(${executable} PRIVATE "${sdk_dir}")
903+
904+
# Include the abi stable system stdlib in our rpath.
905+
list(APPEND RPATH_LIST "/usr/lib/swift")
906+
907+
elseif(LIBSWIFT_BUILD_MODE STREQUAL "CROSSCOMPILE-WITH-HOSTLIBS")
908+
909+
# Intentinally don't add the lib dir of the cross-compiled compiler, so that
910+
# the stdlib is not picked up from there, but from the SDK.
911+
# This requires to explicitly add all the needed compatibility libraries. We
912+
# can take them from the current build.
913+
set(vsuffix "-${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}-${SWIFT_HOST_VARIANT_ARCH}")
914+
set(conctarget "swiftCompatibilityConcurrency${vsuffix}")
915+
target_link_libraries(${executable} PUBLIC ${conctarget})
916+
917+
# Add the SDK directory for the host platform.
918+
target_link_directories(${executable} PRIVATE "${sdk_dir}")
896919
897920
# Include the abi stable system stdlib in our rpath.
898921
list(APPEND RPATH_LIST "/usr/lib/swift")
@@ -901,9 +924,8 @@ function(add_swift_host_tool executable)
901924
# Pick up the built libswiftCompatibility<n>.a libraries
902925
_link_built_compatibility_libs(${executable})
903926
904-
# Add in the SDK directory for the host platform.
905-
target_link_directories(${executable} PRIVATE
906-
${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_ARCH_${SWIFT_HOST_VARIANT_ARCH}_PATH}/usr/lib/swift)
927+
# Add the SDK directory for the host platform.
928+
target_link_directories(${executable} PRIVATE "${sdk_dir}")
907929
908930
# Include the abi stable system stdlib in our rpath.
909931
list(APPEND RPATH_LIST "/usr/lib/swift")
@@ -949,8 +971,7 @@ function(add_swift_host_tool executable)
949971
# NOTE: We do this /after/ target_link_directorying TOOLCHAIN_LIB_DIR to
950972
# ensure that we first find libraries from the toolchain, rather than from
951973
# the SDK.
952-
target_link_directories(${executable} PRIVATE
953-
${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_ARCH_${SWIFT_HOST_VARIANT_ARCH}_PATH}/usr/lib/swift)
974+
target_link_directories(${executable} PRIVATE "${sdk_dir}")
954975
955976
# We also want to be able to find libraries from the base toolchain
956977
# directory. This is so swiftc can rely on its own host side dylibs that may

cmake/modules/SwiftUtils.cmake

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,17 @@ function(get_bootstrapping_swift_lib_dir bs_lib_dir bootstrapping)
112112
endfunction()
113113

114114
function(add_bootstrapping_target bootstrapping)
115-
if(${LIBSWIFT_BUILD_MODE} STREQUAL "BOOTSTRAPPING" OR
116-
${LIBSWIFT_BUILD_MODE} STREQUAL "BOOTSTRAPPING-WITH-HOSTLIBS")
115+
if(${LIBSWIFT_BUILD_MODE} MATCHES "BOOTSTRAPPING.*")
117116

118117
set(target "bootstrapping${bootstrapping}-all")
119118
add_custom_target(${target})
120119

120+
if(${LIBSWIFT_BUILD_MODE} STREQUAL "BOOTSTRAPPING")
121+
set(lib_target "bootstrapping${bootstrapping}-corelib")
122+
add_custom_target(${lib_target})
123+
add_dependencies(${target} ${lib_target})
124+
endif()
125+
121126
if(SWIFT_PATH_TO_LIBICU_BUILD)
122127
# Need to symlink the libicu libraries to be able to run
123128
# the bootstrapping compiler with a custom library path.

libswift/CMakeLists.txt

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,16 @@ else()
2020

2121
add_subdirectory(Sources)
2222

23-
if(${LIBSWIFT_BUILD_MODE} STREQUAL "HOSTTOOLS")
23+
if(${LIBSWIFT_BUILD_MODE} MATCHES "HOSTTOOLS|CROSSCOMPILE-WITH-HOSTLIBS")
2424

25-
if (NOT CMAKE_Swift_COMPILER)
25+
if (NOT SWIFT_EXEC_FOR_LIBSWIFT)
2626
message(FATAL_ERROR "Need a swift toolchain for building libswift")
2727
endif()
2828

2929
add_libswift("libswift"
3030
SWIFT_EXEC "${SWIFT_EXEC_FOR_LIBSWIFT}")
3131

32-
elseif(${LIBSWIFT_BUILD_MODE} STREQUAL "BOOTSTRAPPING" OR
33-
${LIBSWIFT_BUILD_MODE} STREQUAL "BOOTSTRAPPING-WITH-HOSTLIBS")
32+
elseif(${LIBSWIFT_BUILD_MODE} MATCHES "BOOTSTRAPPING.*")
3433

3534
# Bootstrapping - stage 1, using the compiler from level 0
3635

@@ -45,6 +44,12 @@ else()
4544
SWIFT_EXEC "${CMAKE_BINARY_DIR}/bootstrapping1/bin/swiftc"
4645
DEPENDS "bootstrapping1-all")
4746

47+
if(LIBSWIFT_BUILD_MODE STREQUAL "BOOTSTRAPPING-WITH-HOSTLIBS")
48+
if(EXISTS "${CMAKE_BINARY_DIR}/bootstrapping0/lib/swift/macos/Swift.swiftmodule" OR
49+
EXISTS "${CMAKE_BINARY_DIR}/bootstrapping1/lib/swift/macos/Swift.swiftmodule")
50+
messsage(FATAL_ERROR "Please clean the ${CMAKE_BINARY_DIR}/bootstrapping[01] directories")
51+
endif()
52+
endif()
4853
else()
4954
message(FATAL_ERROR "Unknown LIBSWIFT_BUILD_MODE '${LIBSWIFT_BUILD_MODE}'")
5055
endif()

libswift/README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ With the compiler from step 1, a minimal subset of the standard library is built
4242

4343
This library will be less optimized than the final library build.
4444

45-
In case the build mode is `bootstrapping-with-hostlibs`, only the swiftmodule files of the library are built, but not the binaries. The binaries are not needed because the compiler (and `sil-opt`) link against the system swift libraries.
45+
This step is skipped when the build mode is `bootstrapping-with-hostlibs`.
4646

4747
#### 3. The level-1 _libswift_
4848

4949
The build outputs of level-1 are stored in the `bootstrapping1` directory under the main build directory.
5050

51-
The _libswift_ library is built using the level-0 compiler and standard library from step 1. and 2.
51+
The _libswift_ library is built using the level-0 compiler and standard library from step 2 - or the OS libraries in case of `bootstrapping-with-hostlibs`.
5252

5353
#### 4. The level-1 compiler
5454

@@ -60,11 +60,13 @@ Unless the build mode is `bootstrapping-with-hostlibs`, the level-1 compiler dyn
6060

6161
Like in step 2, a minimal subset of the standard library is built, using the level-1 compiler from step 4.
6262

63-
Unless the build mode is `bootstrapping-with-hostlibs`, in this step, the build system redirects the compiler's dynamic library path to the level-0 library (by setting `DY/LD_LIBRARY_PATH` in `SwiftSource.cmake`:`_compile_swift_files`). This is needed because the level-1 libraries are not built, yet.
63+
In this step, the build system redirects the compiler's dynamic library path to the level-0 library (by setting `DY/LD_LIBRARY_PATH` in `SwiftSource.cmake`:`_compile_swift_files`). This is needed because the level-1 libraries are not built, yet.
64+
65+
This step is skipped when the build mode is `bootstrapping-with-hostlibs`.
6466

6567
#### 6. The final _libswift_
6668

67-
The final _libswift_ is built with the level-1 compiler and standard library from step 4. and 5.
69+
The final _libswift_ is built with the level-1 compiler and standard library from step 5 - or the OS libraries in case of `bootstrapping-with-hostlibs`.
6870

6971
#### 7. The final compiler
7072

stdlib/cmake/modules/AddSwiftStdlib.cmake

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -675,8 +675,7 @@ function(add_swift_target_library_single target name)
675675
MACCATALYST_BUILD_FLAVOR
676676
BACK_DEPLOYMENT_LIBRARY
677677
ENABLE_LTO
678-
BOOTSTRAPPING
679-
MODULE_DEPENDENCY_TARGET)
678+
BOOTSTRAPPING)
680679
set(SWIFTLIB_SINGLE_multiple_parameter_options
681680
C_COMPILE_FLAGS
682681
DEPENDS
@@ -865,10 +864,6 @@ function(add_swift_target_library_single target name)
865864
${BOOTSTRAPPING_arg})
866865
add_swift_source_group("${SWIFTLIB_SINGLE_EXTERNAL_SOURCES}")
867866

868-
if(SWIFTLIB_SINGLE_MODULE_DEPENDENCY_TARGET)
869-
set(${SWIFTLIB_SINGLE_MODULE_DEPENDENCY_TARGET} ${swift_module_dependency_target} PARENT_SCOPE)
870-
endif()
871-
872867
# If there were any swift sources, then a .swiftmodule may have been created.
873868
# If that is the case, then add a target which is an alias of the module files.
874869
set(VARIANT_SUFFIX "-${SWIFT_SDK_${SWIFTLIB_SINGLE_SDK}_LIB_SUBDIR}-${SWIFTLIB_SINGLE_ARCHITECTURE}")

stdlib/public/Platform/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,12 @@ if(${LIBSWIFT_BUILD_MODE} STREQUAL "BOOTSTRAPPING" AND
5555

5656
add_swift_target_library_single(swiftDarwin-bootstrapping0 swiftDarwin
5757
${swiftDarwin_common_bootstrapping_options}
58+
FILE_DEPENDS bootstrapping0-corelib
5859
BOOTSTRAPPING 0)
5960

6061
add_swift_target_library_single(swiftDarwin-bootstrapping1 swiftDarwin
6162
${swiftDarwin_common_bootstrapping_options}
63+
FILE_DEPENDS bootstrapping1-corelib
6264
BOOTSTRAPPING 1)
6365

6466
add_dependencies(bootstrapping1-all swiftDarwin-bootstrapping1)

stdlib/public/SwiftOnoneSupport/CMakeLists.txt

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ set(swiftOnoneSupport_common_options
1010
SWIFT_COMPILE_FLAGS "-parse-stdlib" "-Xllvm" "-sil-inline-generics=false" "-Xfrontend" "-validate-tbd-against-ir=none" "-Xfrontend" "-check-onone-completeness" "-Xfrontend" "-disable-access-control" "${SWIFT_RUNTIME_SWIFT_COMPILE_FLAGS}" "${SWIFT_STANDARD_LIBRARY_SWIFT_FLAGS}"
1111
LINK_FLAGS "${SWIFT_RUNTIME_SWIFT_LINK_FLAGS}")
1212

13-
if(CMAKE_BUILD_TYPE STREQUAL "Debug" AND
14-
(${LIBSWIFT_BUILD_MODE} STREQUAL "BOOTSTRAPPING" OR
15-
${LIBSWIFT_BUILD_MODE} STREQUAL "BOOTSTRAPPING-WITH-HOSTLIBS"))
16-
13+
if(CMAKE_BUILD_TYPE STREQUAL "Debug" AND ${LIBSWIFT_BUILD_MODE} STREQUAL "BOOTSTRAPPING")
1714

1815
set(swiftOnoneSupport_common_bootstrapping_options
1916
SHARED
@@ -27,27 +24,19 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug" AND
2724

2825
add_swift_target_library_single(swiftSwiftOnoneSupport-bootstrapping0 swiftSwiftOnoneSupport
2926
${swiftOnoneSupport_common_bootstrapping_options}
30-
MODULE_DEPENDENCY_TARGET swiftOnoneSupport_module_bootstrapping0
27+
FILE_DEPENDS swiftCore-bootstrapping0
3128
BOOTSTRAPPING 0)
3229

33-
if(LIBSWIFT_BUILD_MODE STREQUAL "BOOTSTRAPPING-WITH-HOSTLIBS")
34-
add_dependencies(bootstrapping0-all ${swiftOnoneSupport_module_bootstrapping0})
35-
else()
36-
add_dependencies(bootstrapping0-all swiftSwiftOnoneSupport-bootstrapping0)
37-
endif()
30+
add_dependencies(bootstrapping0-corelib swiftSwiftOnoneSupport-bootstrapping0)
3831

3932
# Bootstrapping - stage 1
4033

4134
add_swift_target_library_single(swiftSwiftOnoneSupport-bootstrapping1 swiftSwiftOnoneSupport
4235
${swiftOnoneSupport_common_bootstrapping_options}
43-
MODULE_DEPENDENCY_TARGET swiftOnoneSupport_module_bootstrapping1
36+
FILE_DEPENDS swiftCore-bootstrapping1
4437
BOOTSTRAPPING 1)
4538

46-
if(LIBSWIFT_BUILD_MODE STREQUAL "BOOTSTRAPPING-WITH-HOSTLIBS")
47-
add_dependencies(bootstrapping1-all ${swiftOnoneSupport_module_bootstrapping1})
48-
else()
49-
add_dependencies(bootstrapping1-all swiftSwiftOnoneSupport-bootstrapping1)
50-
endif()
39+
add_dependencies(bootstrapping1-corelib swiftSwiftOnoneSupport-bootstrapping1)
5140

5241
endif()
5342

stdlib/public/SwiftShims/CMakeLists.txt

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -156,27 +156,30 @@ if(NOT SWIFT_BUILT_STANDALONE)
156156
endforeach()
157157
endif()
158158

159-
foreach(bootstrapping "0" "1")
160-
get_bootstrapping_path(outdir ${SWIFTLIB_DIR} ${bootstrapping})
161-
set(target_name "symlink-headers-bootstrapping${bootstrapping}")
159+
if(${LIBSWIFT_BUILD_MODE} MATCHES "BOOTSTRAPPING.*")
160+
foreach(bootstrapping "0" "1")
161+
get_bootstrapping_path(outdir ${SWIFTLIB_DIR} ${bootstrapping})
162+
set(target_name "symlink-headers-bootstrapping${bootstrapping}")
162163

163-
add_custom_command_target(unused_var
164-
COMMAND
165-
"${CMAKE_COMMAND}" "-E" "make_directory" "${outdir}"
166-
COMMAND
167-
"${CMAKE_COMMAND}" "-E" ${cmake_symlink_option}
168-
${output_dir} "${outdir}/shims"
169-
COMMAND
170-
"${CMAKE_COMMAND}" "-E" "${cmake_symlink_option}"
171-
"${clang_headers_location}"
172-
"${outdir}/clang"
164+
add_custom_command_target(unused_var
165+
COMMAND
166+
"${CMAKE_COMMAND}" "-E" "make_directory" "${outdir}"
167+
COMMAND
168+
"${CMAKE_COMMAND}" "-E" ${cmake_symlink_option}
169+
${output_dir} "${outdir}/shims"
170+
COMMAND
171+
"${CMAKE_COMMAND}" "-E" "${cmake_symlink_option}"
172+
"${clang_headers_location}"
173+
"${outdir}/clang"
173174

174-
CUSTOM_TARGET_NAME ${target_name}
175-
OUTPUT "${outdir}/shims" "${outdir}/clang"
176-
COMMENT "Symlinking headers for bootstrapping0")
175+
CUSTOM_TARGET_NAME ${target_name}
176+
OUTPUT "${outdir}/shims" "${outdir}/clang"
177+
COMMENT "Symlinking headers for bootstrapping0")
177178

178-
add_dependencies(${target_name} copy_shim_headers)
179-
endforeach()
179+
add_dependencies(${target_name} copy_shim_headers)
180+
add_dependencies(bootstrapping${bootstrapping}-all ${target_name})
181+
endforeach()
182+
endif()
180183

181184
swift_install_in_component(FILES ${sources}
182185
DESTINATION "lib/swift/shims"

stdlib/public/core/CMakeLists.txt

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -337,8 +337,7 @@ set(swiftCore_common_options
337337
set(swiftCore_common_dependencies
338338
copy_shim_headers "${SWIFTLIB_DIR}/shims" ${GROUP_INFO_JSON_FILE})
339339

340-
if(${LIBSWIFT_BUILD_MODE} STREQUAL "BOOTSTRAPPING" OR
341-
${LIBSWIFT_BUILD_MODE} STREQUAL "BOOTSTRAPPING-WITH-HOSTLIBS")
340+
if(${LIBSWIFT_BUILD_MODE} STREQUAL "BOOTSTRAPPING")
342341

343342
list(FIND SWIFT_STDLIB_LIBRARY_BUILD_TYPES "SHARED" index_of_shared)
344343
if(index_of_shared EQUAL -1)
@@ -359,7 +358,6 @@ if(${LIBSWIFT_BUILD_MODE} STREQUAL "BOOTSTRAPPING" OR
359358
${swiftCore_common_bootstrapping_options}
360359
FILE_DEPENDS
361360
symlink-headers-bootstrapping0 ${swiftCore_common_dependencies}
362-
MODULE_DEPENDENCY_TARGET swiftCore_module_bootstrapping0
363361
BOOTSTRAPPING 0)
364362

365363
# Bootstrapping - stage 1
@@ -368,18 +366,10 @@ if(${LIBSWIFT_BUILD_MODE} STREQUAL "BOOTSTRAPPING" OR
368366
${swiftCore_common_bootstrapping_options}
369367
FILE_DEPENDS
370368
symlink-headers-bootstrapping1 ${swiftCore_common_dependencies}
371-
MODULE_DEPENDENCY_TARGET swiftCore_module_bootstrapping1
372369
BOOTSTRAPPING 1)
373370

374-
if(LIBSWIFT_BUILD_MODE STREQUAL "BOOTSTRAPPING-WITH-HOSTLIBS")
375-
# When linking swift-frontend against the system swift libraries, it's
376-
# sufficient to create the swiftmodule files for bootstrapping.
377-
add_dependencies(bootstrapping0-all ${swiftCore_module_bootstrapping0})
378-
add_dependencies(bootstrapping1-all ${swiftCore_module_bootstrapping1})
379-
else()
380-
add_dependencies(bootstrapping1-all swiftCore-bootstrapping1)
381-
add_dependencies(bootstrapping0-all swiftCore-bootstrapping0)
382-
endif()
371+
add_dependencies(bootstrapping1-corelib swiftCore-bootstrapping1)
372+
add_dependencies(bootstrapping0-corelib swiftCore-bootstrapping0)
383373
endif()
384374

385375
add_swift_target_library(swiftCore

0 commit comments

Comments
 (0)