Skip to content

Commit 7ee2a5c

Browse files
authored
Merge pull request #37186 from Catfish-Man/missing-dependency
2 parents 2fdebcc + b162186 commit 7ee2a5c

File tree

4 files changed

+19
-5
lines changed

4 files changed

+19
-5
lines changed

stdlib/public/Darwin/Dispatch/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ add_swift_target_library(swiftDispatch ${SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES}
1818

1919
SWIFT_COMPILE_FLAGS ${SWIFT_RUNTIME_SWIFT_COMPILE_FLAGS} ${SWIFT_STANDARD_LIBRARY_SWIFT_FLAGS}
2020
LINK_FLAGS "${SWIFT_RUNTIME_SWIFT_LINK_FLAGS}"
21-
SWIFT_MODULE_DEPENDS_OSX Darwin ObjectiveC # auto-updated
22-
SWIFT_MODULE_DEPENDS_IOS Darwin ObjectiveC # auto-updated
23-
SWIFT_MODULE_DEPENDS_TVOS Darwin ObjectiveC # auto-updated
24-
SWIFT_MODULE_DEPENDS_WATCHOS Darwin ObjectiveC # auto-updated
21+
SWIFT_MODULE_DEPENDS_OSX _Concurrency Darwin ObjectiveC # auto-updated
22+
SWIFT_MODULE_DEPENDS_IOS _Concurrency Darwin ObjectiveC # auto-updated
23+
SWIFT_MODULE_DEPENDS_TVOS _Concurrency Darwin ObjectiveC # auto-updated
24+
SWIFT_MODULE_DEPENDS_WATCHOS _Concurrency Darwin ObjectiveC # auto-updated
2525
FRAMEWORK_DEPENDS_WEAK Combine
2626

2727
DEPLOYMENT_VERSION_OSX ${SWIFTLIB_DEPLOYMENT_VERSION_DISPATCH_OSX}

test/Unit/lit.cfg

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,16 @@ config.test_format = lit.formats.GoogleTest(config.build_mode, 'Tests')
7777
# module cache for all those tests that do not set that explicitly
7878
if 'XDG_CACHE_HOME' in os.environ:
7979
config.environment['XDG_CACHE_HOME'] = os.environ['XDG_CACHE_HOME']
80+
81+
# Find the resource directory. Assume it's near the swift compiler if not set.
82+
test_resource_dir = lit_config.params.get('test_resource_dir')
83+
if not test_resource_dir:
84+
test_resource_dir = config.swiftlib_dir
85+
86+
if 'use_os_stdlib' not in lit_config.params:
87+
# Ensure we load the libraries from the just built compiler
88+
# when building on Darwin
89+
# This is needed in addition to what is done in `add_swift_unittest`
90+
# to handle dependencies of the dylibs loaded by `SwiftRuntimeTests`
91+
# (for which we cannot run `swift-rpathize.py`)
92+
config.environment['DYLD_LIBRARY_PATH'] = os.path.join(test_resource_dir, 'macosx')

test/Unit/lit.site.cfg.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ config.llvm_libs_dir = "@LLVM_LIBS_DIR@"
77
config.build_mode = lit_config.params.get('build_mode', "@SWIFT_BUILD_MODE@")
88
config.swift_obj_root = "@SWIFT_BINARY_DIR@"
99
config.target_triple = "@TARGET_TRIPLE@"
10+
config.swiftlib_dir = "@LIT_SWIFTLIB_DIR@"
1011
config.swift_test_results_dir = \
1112
lit_config.params.get("swift_test_results_dir", "@SWIFT_TEST_RESULTS_DIR@")
1213

unittests/runtime/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ if(("${SWIFT_HOST_VARIANT_SDK}" STREQUAL "${SWIFT_PRIMARY_VARIANT_SDK}") AND
5050
# some stdlib hooks to implement SwiftObject.
5151
list(APPEND PLATFORM_TARGET_LINK_LIBRARIES
5252
${FOUNDATION_LIBRARY}
53+
swift_Concurrency${SWIFT_PRIMARY_VARIANT_SUFFIX}
5354
swiftStdlibUnittest${SWIFT_PRIMARY_VARIANT_SUFFIX}
5455
)
5556
elseif(SWIFT_HOST_VARIANT STREQUAL "Linux")
@@ -129,4 +130,3 @@ if(("${SWIFT_HOST_VARIANT_SDK}" STREQUAL "${SWIFT_PRIMARY_VARIANT_SDK}") AND
129130
${PLATFORM_TARGET_LINK_LIBRARIES}
130131
)
131132
endif()
132-

0 commit comments

Comments
 (0)