Skip to content

Commit 65fd24d

Browse files
committed
stdlib: restrict pthreads to POSIX platforms
pthreads is not available on non-POSIX platforms (i.e. Windows). Restrict the target platforms that we build SwiftPrivatePthreadExtras and things which depend on it.
1 parent b496019 commit 65fd24d

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

stdlib/private/StdlibCollectionUnittest/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ if(SWIFT_HOST_VARIANT MATCHES "${SWIFT_DARWIN_VARIANTS}")
99
Foundation)
1010
endif()
1111

12+
# TODO: support this on non-POSIX platforms. It cannot be currently as it
13+
# depends on pthreads.
1214
add_swift_library(swiftStdlibCollectionUnittest ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
1315
# This file should be listed the first. Module name is inferred from the
1416
# filename.
@@ -28,6 +30,7 @@ add_swift_library(swiftStdlibCollectionUnittest ${SWIFT_STDLIB_LIBRARY_BUILD_TYP
2830

2931
SWIFT_MODULE_DEPENDS StdlibUnittest
3032
SWIFT_COMPILE_FLAGS ${swift_stdlib_unittest_compile_flags}
33+
TARGET_SDKS ALL_POSIX_PLATFORMS
3134
FRAMEWORK_DEPENDS ${swift_stdlib_unittest_framework_depends}
3235
INSTALL_IN_COMPONENT stdlib-experimental)
3336

stdlib/private/StdlibUnittest/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ if(SWIFT_HOST_VARIANT MATCHES "${SWIFT_DARWIN_VARIANTS}")
1414
list(APPEND swift_stdlib_unittest_framework_depends Foundation)
1515
endif()
1616

17+
# TODO: support this on non-POSIX platforms. It cannot be currently as it
18+
# depends on pthreads.
1719
add_swift_library(swiftStdlibUnittest ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
1820
# This file should be listed the first. Module name is inferred from the
1921
# filename.
@@ -40,6 +42,7 @@ add_swift_library(swiftStdlibUnittest ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STD
4042
SWIFT_MODULE_DEPENDS_LINUX Glibc
4143
SWIFT_MODULE_DEPENDS_FREEBSD Glibc
4244
SWIFT_COMPILE_FLAGS ${swift_stdlib_unittest_compile_flags}
45+
TARGET_SDKS ALL_POSIX_PLATFORMS
4346
FRAMEWORK_DEPENDS ${swift_stdlib_unittest_framework_depends}
4447
INSTALL_IN_COMPONENT stdlib-experimental)
4548

stdlib/private/SwiftPrivatePthreadExtras/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@ add_swift_library(swiftSwiftPrivatePthreadExtras ${SWIFT_STDLIB_LIBRARY_BUILD_TY
1111
SWIFT_MODULE_DEPENDS_LINUX Glibc
1212
SWIFT_MODULE_DEPENDS_FREEBSD Glibc
1313
SWIFT_COMPILE_FLAGS ${STDLIB_SIL_SERIALIZE_ALL}
14+
TARGET_SDKS ALL_POSIX_PLATFORMS
1415
INSTALL_IN_COMPONENT stdlib-experimental)
1516

0 commit comments

Comments
 (0)