Skip to content

Commit 7eb0ca1

Browse files
authored
Merge pull request swiftlang#39568 from DougGregor/back-deploy-objc-actor
2 parents 63e892f + 0ab6355 commit 7eb0ca1

File tree

4 files changed

+33
-8
lines changed

4 files changed

+33
-8
lines changed

stdlib/public/BackDeployConcurrency/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ set(swift_concurrency_options
4949
DARWIN_INSTALL_NAME_DIR "@rpath")
5050
set(swift_concurrency_extra_sources
5151
"../BackDeployConcurrency/Exclusivity.cpp"
52-
"../BackDeployConcurrency/Metadata.cpp")
52+
"../BackDeployConcurrency/Metadata.cpp"
53+
"../stubs/SwiftNativeNSObject.mm")
5354
set(swift_concurrency_async_fp_mode "never")
5455

5556
add_subdirectory(../Concurrency stdlib/public/BackDeployConcurrency)

stdlib/public/CMakeLists.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,13 @@ if(SWIFT_BUILD_STDLIB OR SWIFT_BUILD_REMOTE_MIRROR)
7979
INSTALL_IN_COMPONENT never_install)
8080
endif()
8181

82+
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
83+
list(APPEND SWIFT_RUNTIME_CONCURRENCY_SWIFT_LINK_FLAGS
84+
"-Wl,-reexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/Concurrency/ReexportedSymbols")
85+
endif()
86+
87+
list(APPEND SWIFT_RUNTIME_CONCURRENCY_SWIFT_LINK_FLAGS "${SWIFT_RUNTIME_SWIFT_LINK_FLAGS}")
88+
8289
if(SWIFT_BUILD_STDLIB)
8390
# These must be kept in dependency order so that any referenced targets
8491
# exist at the time we look for them in add_swift_*.
@@ -117,10 +124,3 @@ if(SWIFT_BUILD_SDK_OVERLAY)
117124
add_subdirectory(Windows)
118125
endif()
119126
endif()
120-
121-
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
122-
list(APPEND SWIFT_RUNTIME_CONCURRENCY_SWIFT_LINK_FLAGS
123-
"-Wl,-reexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/Concurrency/ReexportedSymbols")
124-
endif()
125-
126-
list(APPEND SWIFT_RUNTIME_CONCURRENCY_SWIFT_LINK_FLAGS "${SWIFT_RUNTIME_SWIFT_LINK_FLAGS}")

test/Concurrency/Backdeploy/mangling.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
// REQUIRES: CPU=x86_64
1616
// REQUIRES: OS=macosx
1717
// REQUIRES: executable_test
18+
// REQUIRES: concurrency_runtime
1819
actor MyActor { }
1920

2021
protocol MyProtocol {
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// RUN: %empty-directory(%t)
2+
// RUN: %target-build-swift -target x86_64-apple-macosx10.15 %s -o %t/test_mangling -Xfrontend -disable-availability-checking -parse-as-library
3+
// RUN: %target-run %t/test_mangling
4+
5+
// REQUIRES: CPU=x86_64
6+
// REQUIRES: OS=macosx
7+
// REQUIRES: executable_test
8+
// REQUIRES: concurrency_runtime
9+
10+
import Foundation
11+
12+
@objc actor MyActor {
13+
func f() -> String { "hello" }
14+
}
15+
16+
@main
17+
enum Main {
18+
static func main() async {
19+
let ma = MyActor()
20+
let greeting = await ma.f()
21+
assert(greeting == "hello")
22+
}
23+
}

0 commit comments

Comments
 (0)