|
4 | 4 | import PackageDescription |
5 | 5 |
|
6 | 6 | var buildSettings: [CXXSetting] = [ |
7 | | - .define("DEBUG", to: "1", .when(configuration: .debug)), |
8 | | - .define("U_ATTRIBUTE_DEPRECATED", to: ""), |
9 | | - .define("U_SHOW_CPLUSPLUS_API", to: "1"), |
10 | | - .define("U_SHOW_INTERNAL_API", to: "1"), |
11 | | - .define("U_STATIC_IMPLEMENTATION"), |
12 | | - .define("U_TIMEZONE", to: "_timezone", .when(platforms: [.windows])), |
13 | | - .define("U_TIMEZONE", to: "timezone", |
14 | | - .when(platforms: [ |
15 | | - .iOS, |
16 | | - .macOS, |
17 | | - .tvOS, |
18 | | - .watchOS, |
19 | | - .macCatalyst, |
20 | | - .driverKit, |
21 | | - .android, |
22 | | - .linux, |
23 | | - ])), |
24 | | - .define("U_TIMEZONE_PACKAGE", to: "\"icutz44l\""), |
25 | | - .define("U_HAVE_TZSET", to: "0", .when(platforms: [.wasi])), |
26 | | - .define("U_HAVE_TZNAME", to: "0", .when(platforms: [.wasi])), |
27 | | - .define("U_HAVE_TIMEZONE", to: "0", .when(platforms: [.wasi])), |
28 | | - .define("FORTIFY_SOURCE", to: "2"), |
29 | | - .define("STD_INSPIRED"), |
30 | | - .define("MAC_OS_X_VERSION_MIN_REQUIRED", to: "101500"), |
31 | | - .define("_WASI_EMULATED_SIGNAL", .when(platforms: [.wasi])), |
32 | | - .define("_WASI_EMULATED_MMAN", .when(platforms: [.wasi])), |
33 | | - .define("U_HAVE_STRTOD_L", to: "1"), |
34 | | - .define("U_HAVE_XLOCALE_H", to: "1"), |
35 | | - .define("U_HAVE_STRING_VIEW", to: "1"), |
36 | | - .define("U_DISABLE_RENAMING", to: "1"), |
37 | | - .define("U_COMBINED_IMPLEMENTATION"), |
38 | | - .define("U_COMMON_IMPLEMENTATION"), |
39 | | - .define("U_I18N_IMPLEMENTATION"), |
40 | | - .define("U_IO_IMPLEMENTATION"), |
41 | | - .define("HAVE_DLFCN_H", to: "0", .when(platforms: [.wasi])), |
42 | | - .define("HAVE_DLOPEN", to: "0", .when(platforms: [.wasi])), |
43 | | - .define("U_ENABLE_DYLOAD", to: "0", .when(platforms: [.wasi])), |
| 7 | + .define("DEBUG", to: "1", .when(configuration: .debug)), |
| 8 | + .define("U_ATTRIBUTE_DEPRECATED", to: ""), |
| 9 | + .define("U_SHOW_CPLUSPLUS_API", to: "1"), |
| 10 | + .define("U_SHOW_INTERNAL_API", to: "1"), |
| 11 | + .define("U_STATIC_IMPLEMENTATION"), |
| 12 | + .define("U_TIMEZONE", to: "_timezone", .when(platforms: [.windows])), |
| 13 | + .define( |
| 14 | + "U_TIMEZONE", to: "timezone", |
| 15 | + .when(platforms: [ |
| 16 | + .iOS, |
| 17 | + .macOS, |
| 18 | + .tvOS, |
| 19 | + .watchOS, |
| 20 | + .macCatalyst, |
| 21 | + .driverKit, |
| 22 | + .android, |
| 23 | + .linux, |
| 24 | + ])), |
| 25 | + .define("U_TIMEZONE_PACKAGE", to: "\"icutz44l\""), |
| 26 | + .define("U_HAVE_TZSET", to: "0", .when(platforms: [.wasi])), |
| 27 | + .define("U_HAVE_TZNAME", to: "0", .when(platforms: [.wasi])), |
| 28 | + .define("U_HAVE_TIMEZONE", to: "0", .when(platforms: [.wasi])), |
| 29 | + .define("FORTIFY_SOURCE", to: "2"), |
| 30 | + .define("STD_INSPIRED"), |
| 31 | + .define("MAC_OS_X_VERSION_MIN_REQUIRED", to: "101500"), |
| 32 | + .define("_WASI_EMULATED_SIGNAL", .when(platforms: [.wasi])), |
| 33 | + .define("_WASI_EMULATED_MMAN", .when(platforms: [.wasi])), |
| 34 | + .define("U_HAVE_STRTOD_L", to: "1"), |
| 35 | + .define("U_HAVE_XLOCALE_H", to: "1"), |
| 36 | + .define("U_HAVE_STRING_VIEW", to: "1"), |
| 37 | + .define("U_DISABLE_RENAMING", to: "1"), |
| 38 | + .define("U_COMBINED_IMPLEMENTATION"), |
| 39 | + .define("U_COMMON_IMPLEMENTATION"), |
| 40 | + .define("U_I18N_IMPLEMENTATION"), |
| 41 | + .define("U_IO_IMPLEMENTATION"), |
| 42 | + .define("HAVE_DLFCN_H", to: "0", .when(platforms: [.wasi])), |
| 43 | + .define("HAVE_DLOPEN", to: "0", .when(platforms: [.wasi])), |
| 44 | + .define("U_ENABLE_DYLOAD", to: "0", .when(platforms: [.wasi])), |
44 | 45 |
|
45 | | - // Where data are stored |
46 | | - .define("ICU_DATA_DIR", to: "\"/usr/share/icu/\""), |
47 | | - .define("USE_PACKAGE_DATA", to: "1"), |
48 | | - .define("APPLE_ICU_CHANGES", to: "1"), |
49 | | - |
50 | | - .headerSearchPath("common"), |
51 | | - .headerSearchPath("io"), |
52 | | - .headerSearchPath("i18n"), |
53 | | - .define("SWIFT_PACKAGE", to: "1", .when(platforms: [.linux])), |
| 46 | + // Where data are stored |
| 47 | + .define("ICU_DATA_DIR", to: "\"/usr/share/icu/\""), |
| 48 | + .define("USE_PACKAGE_DATA", to: "1"), |
| 49 | + .define("APPLE_ICU_CHANGES", to: "1"), |
| 50 | + |
| 51 | + .headerSearchPath("common"), |
| 52 | + .headerSearchPath("io"), |
| 53 | + .headerSearchPath("i18n"), |
| 54 | + .define("SWIFT_PACKAGE", to: "1", .when(platforms: [.linux])), |
54 | 55 | ] |
55 | 56 |
|
56 | 57 | #if os(Windows) |
57 | | -buildSettings.append(contentsOf: [ |
| 58 | + buildSettings.append(contentsOf: [ |
58 | 59 | .define("_CRT_SECURE_NO_DEPRECATE"), |
59 | 60 | .define("U_PLATFORM_USES_ONLY_WIN32_API"), |
60 | | -]) |
| 61 | + ]) |
61 | 62 | #endif |
62 | 63 |
|
63 | 64 | let linkerSettings: [LinkerSetting] = [ |
64 | | - .linkedLibrary("wasi-emulated-signal", .when(platforms: [.wasi])), |
65 | | - .linkedLibrary("wasi-emulated-mman", .when(platforms: [.wasi])), |
| 65 | + .linkedLibrary("wasi-emulated-signal", .when(platforms: [.wasi])), |
| 66 | + .linkedLibrary("wasi-emulated-mman", .when(platforms: [.wasi])), |
66 | 67 | ] |
67 | 68 |
|
68 | 69 | let package = Package( |
69 | | - name: "FoundationICU", |
70 | | - products: [ |
71 | | - .library( |
72 | | - name: "_FoundationICU", |
73 | | - targets: [ |
74 | | - "_FoundationICU" |
75 | | - ] |
76 | | - ) |
77 | | - ], |
78 | | - targets: [ |
79 | | - .target( |
80 | | - name: "_FoundationICU", |
81 | | - path: "icuSources", |
82 | | - exclude: ["stubdata"], |
83 | | - cxxSettings: buildSettings, |
84 | | - linkerSettings: linkerSettings |
85 | | - ) |
86 | | - ], |
87 | | - cxxLanguageStandard: .cxx14 |
| 70 | + name: "FoundationICU", |
| 71 | + products: [ |
| 72 | + .library( |
| 73 | + name: "_FoundationICU", |
| 74 | + targets: [ |
| 75 | + "_FoundationICU" |
| 76 | + ] |
| 77 | + ) |
| 78 | + ], |
| 79 | + targets: [ |
| 80 | + .target( |
| 81 | + name: "_FoundationICU", |
| 82 | + path: "icuSources", |
| 83 | + exclude: ["stubdata"], |
| 84 | + cxxSettings: buildSettings, |
| 85 | + linkerSettings: linkerSettings |
| 86 | + ) |
| 87 | + ], |
| 88 | + cxxLanguageStandard: .cxx14 |
88 | 89 | ) |
0 commit comments