Skip to content

Commit b07a0ab

Browse files
committed
[SwiftCompilerSources][build] Fix build with SWIFT_STDLIB_SUPPORT_BACK_DEPLOYMENT=NO
This allows building SwiftCompilerSources with stdlib compatibility disabled. Fixes errors like this: ``` [699/716] Building swift module Basic FAILED: bootstrapping1/SwiftCompilerSources/Basic.o /Users/egorzh/Builds.noindex/swift/swift-release/bootstrapping1/SwiftCompilerSources/Basic.o cd /Volumes/Projects/swift/swift/SwiftCompilerSources && /Users/egorzh/Builds.noindex/swift/swift-release/bootstrapping0/bin/swiftc -c -o /Users/egorzh/Builds.noindex/swift/swift-release/bootstrapping1/SwiftCompilerSources/Basic.o -sdk /Applications/Xcodes/XcodeSummit.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk -target x86_64-apple-macosx10.9 -module-name Basic -emit-module -emit-module-path /Users/egorzh/Builds.noindex/swift/swift-release/bootstrapping1/SwiftCompilerSources/Basic.swiftmodule -parse-as-library /Volumes/Projects/swift/swift/SwiftCompilerSources/Sources/Basic/SourceLoc.swift /Volumes/Projects/swift/swift/SwiftCompilerSources/Sources/Basic/Utils.swift -wmo -Xfrontend -validate-tbd-against-ir=none -Xfrontend -enable-cxx-interop -Xcc -UIBOutlet -Xcc -UIBAction -Xcc -UIBInspectable -O -cross-module-optimization -Xcc -I -Xcc /Volumes/Projects/swift/swift/include -Xcc -I -Xcc /Users/egorzh/Builds.noindex/swift/swift-release/include -I /Users/egorzh/Builds.noindex/swift/swift-release/bootstrapping1/SwiftCompilerSources <unknown>:0: error: IR generation failure: Cannot read legacy layout file at '/Users/egorzh/Builds.noindex/swift/swift-release/bootstrapping0/lib/swift/macosx/layouts-x86_64.yaml' ninja: build stopped: subcommand failed. ```
1 parent 55fb3d1 commit b07a0ab

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

SwiftCompilerSources/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ function(add_swift_compiler_modules_library name)
8383
list(APPEND swift_compile_options "-O" "-cross-module-optimization")
8484
endif()
8585

86+
if(NOT SWIFT_STDLIB_SUPPORT_BACK_DEPLOYMENT)
87+
list(APPEND swift_compile_options "-Xfrontend" "-disable-legacy-type-info")
88+
endif()
89+
8690
get_bootstrapping_path(build_dir ${CMAKE_CURRENT_BINARY_DIR} "${ALS_BOOTSTRAPPING}")
8791

8892
set(sdk_option "")
@@ -230,7 +234,7 @@ else()
230234
list(APPEND b1_deps copy-libstdcxx-modulemap-bootstrapping1 copy-libstdcxx-header-bootstrapping1)
231235
endif()
232236
endif()
233-
if(SWIFT_HOST_VARIANT_SDK IN_LIST SWIFT_DARWIN_PLATFORMS)
237+
if(SWIFT_HOST_VARIANT_SDK IN_LIST SWIFT_DARWIN_PLATFORMS AND SWIFT_STDLIB_SUPPORT_BACK_DEPLOYMENT)
234238
set(platform ${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR})
235239
set(compatibility_libs
236240
"swiftCompatibility50-${platform}"

0 commit comments

Comments
 (0)