|
3 | 3 |
|
4 | 4 | import PackageDescription
|
5 | 5 |
|
| 6 | +let platformsWithThreads: [Platform] = [ |
| 7 | + .iOS, |
| 8 | + .macOS, |
| 9 | + .tvOS, |
| 10 | + .watchOS, |
| 11 | + .macCatalyst, |
| 12 | + .driverKit, |
| 13 | + .android, |
| 14 | + .linux, |
| 15 | +] |
6 | 16 | var dispatchIncludeFlags: [CSetting]
|
7 | 17 | if let environmentPath = Context.environment["DISPATCH_INCLUDE_PATH"] {
|
8 | 18 | dispatchIncludeFlags = [.unsafeFlags([
|
@@ -31,8 +41,11 @@ let coreFoundationBuildSettings: [CSetting] = [
|
31 | 41 | .define("DEPLOYMENT_ENABLE_LIBDISPATCH"),
|
32 | 42 | .define("DEPLOYMENT_RUNTIME_SWIFT"),
|
33 | 43 | .define("HAVE_STRUCT_TIMESPEC"),
|
34 |
| - .define("SWIFT_CORELIBS_FOUNDATION_HAS_THREADS"), |
| 44 | + .define("SWIFT_CORELIBS_FOUNDATION_HAS_THREADS", .when(platforms: platformsWithThreads)), |
35 | 45 | .define("_GNU_SOURCE", .when(platforms: [.linux, .android])),
|
| 46 | + .define("_WASI_EMULATED_SIGNAL", .when(platforms: [.wasi])), |
| 47 | + .define("HAVE_STRLCPY", .when(platforms: [.wasi])), |
| 48 | + .define("HAVE_STRLCAT", .when(platforms: [.wasi])), |
36 | 49 | .unsafeFlags([
|
37 | 50 | "-Wno-shorten-64-to-32",
|
38 | 51 | "-Wno-deprecated-declarations",
|
@@ -61,8 +74,11 @@ let interfaceBuildSettings: [CSetting] = [
|
61 | 74 | .define("CF_BUILDING_CF"),
|
62 | 75 | .define("DEPLOYMENT_ENABLE_LIBDISPATCH"),
|
63 | 76 | .define("HAVE_STRUCT_TIMESPEC"),
|
64 |
| - .define("SWIFT_CORELIBS_FOUNDATION_HAS_THREADS"), |
| 77 | + .define("SWIFT_CORELIBS_FOUNDATION_HAS_THREADS", .when(platforms: platformsWithThreads)), |
65 | 78 | .define("_GNU_SOURCE", .when(platforms: [.linux, .android])),
|
| 79 | + .define("_WASI_EMULATED_SIGNAL", .when(platforms: [.wasi])), |
| 80 | + .define("HAVE_STRLCPY", .when(platforms: [.wasi])), |
| 81 | + .define("HAVE_STRLCAT", .when(platforms: [.wasi])), |
66 | 82 | .unsafeFlags([
|
67 | 83 | "-Wno-shorten-64-to-32",
|
68 | 84 | "-Wno-deprecated-declarations",
|
|
0 commit comments