@@ -146,15 +146,39 @@ extension SwiftModule {
146
146
}
147
147
}
148
148
149
+ var headerSearchPaths : ( key: String , value: String ) ? {
150
+ let headerPathKey = " HEADER_SEARCH_PATHS "
151
+ let headerPaths = dependencies. filter { $0 is CModule } . map { ( $0 as! CModule ) . path}
152
+
153
+ guard !headerPaths. isEmpty else { return nil }
154
+
155
+ if headerPaths. count == 1 , let first = headerPaths. first {
156
+ return ( headerPathKey, first)
157
+ }
158
+
159
+ var headerPathValue = " ( \n "
160
+ for header in headerPaths {
161
+ headerPathValue += " \" \( header) \" , "
162
+ }
163
+ headerPathValue += " ) "
164
+
165
+ return ( headerPathKey, headerPathValue)
166
+ }
167
+
149
168
var debugBuildSettings : String {
150
169
var buildSettings = commonBuildSettings
151
170
buildSettings [ " SWIFT_OPTIMIZATION_LEVEL " ] = " -Onone "
152
-
171
+ if let headerSearchPaths = headerSearchPaths {
172
+ buildSettings [ headerSearchPaths. key] = headerSearchPaths. value
173
+ }
153
174
return buildSettings. map { " \( $0) = \( $1) ; " } . joined ( separator: " " )
154
175
}
155
176
156
177
var releaseBuildSettings : String {
157
- let buildSettings = commonBuildSettings
178
+ var buildSettings = commonBuildSettings
179
+ if let headerSearchPaths = headerSearchPaths {
180
+ buildSettings [ headerSearchPaths. key] = headerSearchPaths. value
181
+ }
158
182
return buildSettings. map { " \( $0) = \( $1) ; " } . joined ( separator: " " )
159
183
}
160
184
@@ -163,6 +187,7 @@ extension SwiftModule {
163
187
buildSettings [ " PRODUCT_MODULE_NAME " ] = c99name
164
188
buildSettings [ " OTHER_SWIFT_FLAGS " ] = " -DXcode "
165
189
buildSettings [ " MACOSX_DEPLOYMENT_TARGET " ] = " '10.10' "
190
+ buildSettings [ " LIBRARY_SEARCH_PATHS " ] = " /usr/local/lib "
166
191
167
192
// prevents Xcode project upgrade warnings
168
193
buildSettings [ " COMBINE_HIDPI_IMAGES " ] = " YES "
0 commit comments