Skip to content

Commit 58709e5

Browse files
committed
[CMake] Add a dependency on 'libSwiftScan' for 'swiftCore'
It appears that 'swiftCore' and following associated 'embedded-stdlib-*' targets may begin building before the libSwiftScan library has completed building, which may cause crashes if the compiler process building 'swiftCore' attempts to load it. Resolves rdar://137674862
1 parent 60538d5 commit 58709e5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

stdlib/public/core/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,12 +398,18 @@ if(BOOTSTRAPPING_MODE STREQUAL "BOOTSTRAPPING")
398398
BOOTSTRAPPING 1)
399399
endif()
400400

401+
set(tooling_stdlib_deps)
402+
if(TARGET libSwiftScan)
403+
list(append tooling_stdlib_deps libSwiftScan)
404+
endif()
405+
401406
add_swift_target_library(swiftCore
402407
${SWIFT_STDLIB_LIBRARY_BUILD_TYPES}
403408
${swiftCore_common_options}
404409
${compile_flags_for_final_build}
405410
FILE_DEPENDS
406411
${swiftCore_common_dependencies}
412+
DEPENDS ${tooling_stdlib_deps}
407413
INSTALL_IN_COMPONENT
408414
stdlib
409415
MACCATALYST_BUILD_FLAVOR
@@ -446,6 +452,7 @@ if(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB)
446452
SDK "embedded"
447453
ARCHITECTURE "${arch}"
448454
FILE_DEPENDS ${swiftCore_common_dependencies}
455+
DEPENDS ${tooling_stdlib_deps}
449456
INSTALL_IN_COMPONENT stdlib
450457
)
451458
add_dependencies(embedded-stdlib embedded-stdlib-${mod})

0 commit comments

Comments
 (0)