@@ -153,9 +153,14 @@ public final class XcodeBuildSystem: SPMBuildCore.BuildSystem {
153
153
154
154
// Generate a table of any overriding build settings.
155
155
var settings : [ String : String ] = [ : ]
156
+ // An error with determining the override should not be fatal here.
157
+ settings [ " CC " ] = try ? buildParameters. toolchain. getClangCompiler ( ) . pathString
156
158
// Always specify the path of the effective Swift compiler, which was determined in the same way as for the native build system.
157
159
settings [ " SWIFT_EXEC " ] = buildParameters. toolchain. swiftCompiler. pathString
158
- settings [ " LIBRARY_SEARCH_PATHS " ] = " $(inherited) \( buildParameters. toolchain. toolchainLibDir. pathString) /swift/macosx "
160
+ settings [ " LIBRARY_SEARCH_PATHS " ] = " $(inherited) \( buildParameters. toolchain. toolchainLibDir. pathString) "
161
+ settings [ " OTHER_CFLAGS " ] = " $(inherited) \( buildParameters. toolchain. extraCCFlags. joined ( separator: " " ) ) "
162
+ settings [ " OTHER_CPLUSPLUSFLAGS " ] = " $(inherited) \( buildParameters. toolchain. extraCPPFlags. joined ( separator: " " ) ) "
163
+ settings [ " OTHER_SWIFT_FLAGS " ] = " $(inherited) \( buildParameters. toolchain. extraSwiftCFlags. joined ( separator: " " ) ) "
159
164
// Optionally also set the list of architectures to build for.
160
165
if !buildParameters. archs. isEmpty {
161
166
settings [ " ARCHS " ] = buildParameters. archs. joined ( separator: " " )
@@ -164,7 +169,7 @@ public final class XcodeBuildSystem: SPMBuildCore.BuildSystem {
164
169
// Generate the build parameters.
165
170
let params = XCBBuildParameters (
166
171
configurationName: buildParameters. configuration. xcbuildName,
167
- overrides: . init( commandLine : . init( table: settings) ) ,
172
+ overrides: . init( synthesized : . init( table: settings) ) ,
168
173
activeRunDestination: runDestination
169
174
)
170
175
@@ -226,7 +231,7 @@ struct XCBBuildParameters: Encodable {
226
231
}
227
232
228
233
struct SettingsOverride : Encodable {
229
- var commandLine : XCBSettingsTable ? = nil
234
+ var synthesized : XCBSettingsTable ? = nil
230
235
}
231
236
232
237
var configurationName : String
@@ -247,7 +252,8 @@ extension PIFBuilderParameters {
247
252
public init ( _ buildParameters: BuildParameters ) {
248
253
self . init (
249
254
enableTestability: buildParameters. enableTestability,
250
- shouldCreateDylibForDynamicProducts: buildParameters. shouldCreateDylibForDynamicProducts
255
+ shouldCreateDylibForDynamicProducts: buildParameters. shouldCreateDylibForDynamicProducts,
256
+ toolchainLibDir: buildParameters. toolchain. toolchainLibDir
251
257
)
252
258
}
253
259
}
0 commit comments