@@ -38,7 +38,15 @@ var buildSettings: [CXXSetting] = [
38
38
// Where data are stored
39
39
. define( " ICU_DATA_DIR " , to: " \" /usr/share/icu/ \" " ) ,
40
40
. define( " USE_PACKAGE_DATA " , to: " 1 " ) ,
41
- . define( " APPLE_ICU_CHANGES " , to: " 1 " )
41
+ . define( " APPLE_ICU_CHANGES " , to: " 1 " ) ,
42
+
43
+ . headerSearchPath( " common " ) ,
44
+ . headerSearchPath( " io " ) ,
45
+ . headerSearchPath( " i18n " ) ,
46
+ . headerSearchPath( " include " ) ,
47
+ . define( " U_I18N_IMPLEMENTATION " ) ,
48
+ . define( " SWIFT_PACKAGE " , to: " 1 " , . when( platforms: [ . linux] ) ) ,
49
+ . define( " U_IO_IMPLEMENTATION " ) ,
42
50
]
43
51
44
52
#if os(Windows)
@@ -48,30 +56,6 @@ buildSettings.append(contentsOf: [
48
56
] )
49
57
#endif
50
58
51
- let commonBuildSettings : [ CXXSetting ] = buildSettings. appending ( [
52
- . headerSearchPath( " . " ) ,
53
- ] )
54
-
55
- let i18nBuildSettings : [ CXXSetting ] = buildSettings. appending ( [
56
- . define( " U_I18N_IMPLEMENTATION " ) ,
57
- . define( " SWIFT_PACKAGE " , to: " 1 " , . when( platforms: [ . linux] ) ) ,
58
- . headerSearchPath( " ../common " ) ,
59
- . headerSearchPath( " . " ) ,
60
- ] )
61
-
62
- let ioBuildSettings : [ CXXSetting ] = buildSettings. appending ( [
63
- . define( " U_IO_IMPLEMENTATION " ) ,
64
- . headerSearchPath( " ../common " ) ,
65
- . headerSearchPath( " ../i18n " ) ,
66
- . headerSearchPath( " . " ) ,
67
- ] )
68
-
69
- let stubDataBuildSettings : [ CXXSetting ] = buildSettings. appending ( [
70
- . headerSearchPath( " ../common " ) ,
71
- . headerSearchPath( " ../i18n " ) ,
72
- . headerSearchPath( " . " ) ,
73
- ] )
74
-
75
59
let linkerSettings : [ LinkerSetting ] = [
76
60
. linkedLibrary( " wasi-emulated-signal " , . when( platforms: [ . wasi] ) ) ,
77
61
. linkedLibrary( " wasi-emulated-mman " , . when( platforms: [ . wasi] ) ) ,
@@ -82,62 +66,19 @@ let package = Package(
82
66
products: [
83
67
. library(
84
68
name: " _FoundationICU " ,
85
- targets: [ " _FoundationICU " ] ) ,
86
- . library(
87
- name: " _FoundationICUCommon " ,
88
- targets: [ " _FoundationICUCommon " ] ) ,
89
- . library(
90
- name: " _FoundationICUI18N " ,
91
- targets: [ " _FoundationICUI18N " ] ) ,
92
- . library(
93
- name: " _FoundationICUIO " ,
94
- targets: [ " _FoundationICUIO " ] ) ,
69
+ targets: [
70
+ " _FoundationICU "
71
+ ]
72
+ )
95
73
] ,
96
74
targets: [
97
75
. target(
98
76
name: " _FoundationICU " ,
99
- dependencies: [
100
- " _FoundationICUCommon " ,
101
- " _FoundationICUI18N " ,
102
- " _FoundationICUIO " ,
103
- " _FoundationICUStubData "
104
- ] ,
105
- path: " swift/FoundationICU " ) ,
106
- . target(
107
- name: " _FoundationICUCommon " ,
108
- path: " icuSources/common " ,
109
- publicHeadersPath: " include " ,
110
- cxxSettings: commonBuildSettings) ,
111
- . target(
112
- name: " _FoundationICUI18N " ,
113
- dependencies: [ " _FoundationICUCommon " ] ,
114
- path: " icuSources/i18n " ,
115
- publicHeadersPath: " include " ,
116
- cxxSettings: i18nBuildSettings) ,
117
- . target(
118
- name: " _FoundationICUIO " ,
119
- dependencies: [ " _FoundationICUCommon " , " _FoundationICUI18N " ] ,
120
- path: " icuSources/io " ,
121
- publicHeadersPath: " include " ,
122
- cxxSettings: ioBuildSettings) ,
123
- . target(
124
- name: " _FoundationICUStubData " ,
125
- dependencies: [ " _FoundationICUCommon " ] ,
126
- path: " icuSources/stubdata " ,
127
- publicHeadersPath: " . " ,
128
- cxxSettings: stubDataBuildSettings) ,
77
+ path: " icuSources " ,
78
+ exclude: [ " stubdata " ] ,
79
+ cxxSettings: buildSettings,
80
+ linkerSettings: linkerSettings
81
+ )
129
82
] ,
130
83
cxxLanguageStandard: . cxx14
131
84
)
132
-
133
- for target in package . targets {
134
- target. linkerSettings = linkerSettings
135
- }
136
-
137
- fileprivate extension Array {
138
- func appending( _ other: Self ) -> Self {
139
- var me = self
140
- me. append ( contentsOf: other)
141
- return me
142
- }
143
- }
0 commit comments