Skip to content

Commit bffb878

Browse files
authored
Merge pull request #74160 from hyp/eng/fix-android-synchro
[android] Fix Synchronization Android build
2 parents c961cc1 + 74d2a66 commit bffb878

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

stdlib/public/Synchronization/CMakeLists.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ set(SWIFT_SYNCHRONIZATION_DARWIN_SOURCES
4040
Mutex/DarwinImpl.swift
4141
)
4242

43-
# Linux sources
43+
# Linux and Android sources
4444

4545
set(SWIFT_SYNCHRONIZATION_LINUX_SOURCES
4646
Mutex/LinuxImpl.swift
@@ -102,6 +102,8 @@ add_swift_target_library(swiftSynchronization ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES
102102
Darwin
103103
SWIFT_MODULE_DEPENDS_LINUX
104104
Glibc
105+
SWIFT_MODULE_DEPENDS_ANDROID
106+
Android
105107
SWIFT_MODULE_DEPENDS_WINDOWS
106108
WinSDK
107109

stdlib/public/Synchronization/Mutex/LinuxImpl.swift

+4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
import _SynchronizationShims
14+
#if canImport(Android)
15+
import Android
16+
#else
1417
import Glibc
18+
#endif
1519

1620
extension Atomic where Value == UInt32 {
1721
// This returns 'false' on success and 'true' on error. Check 'errno' for the

0 commit comments

Comments
 (0)