@@ -23,12 +23,12 @@ private enum Architecture: String, CaseIterable {
23
23
case device = " iphoneos "
24
24
case simulator = " iphonesimulator "
25
25
26
- /// Arguments that should be included as part of the build process for each target platform.
27
- func extraArguments ( ) -> [ String ] {
26
+ /// Extra C flags that should be included as part of the build process for each target platform.
27
+ func otherCFlags ( ) -> [ String ] {
28
28
switch self {
29
29
case . device:
30
30
// For device, we want to enable bitcode.
31
- return [ " OTHER_CFLAGS=$(value) " + " -fembed-bitcode " ]
31
+ return [ " -fembed-bitcode " ]
32
32
case . simulator:
33
33
// No extra arguments are required for simulator builds.
34
34
return [ ]
@@ -220,16 +220,17 @@ struct FrameworkBuilder {
220
220
let platform = arch. platform
221
221
let workspacePath = projectDir. appendingPathComponent ( " FrameworkMaker.xcworkspace " ) . path
222
222
let distributionFlag = carthageBuild ? " -DFIREBASE_BUILD_CARTHAGE " : " -DFIREBASE_BUILD_ZIP_FILE "
223
- let standardOptions = [ " build " ,
224
- " -configuration " , " release " ,
225
- " -workspace " , workspacePath,
226
- " -scheme " , framework,
227
- " GCC_GENERATE_DEBUGGING_SYMBOLS=No " ,
228
- " ARCHS= \( arch. rawValue) " ,
229
- " BUILD_DIR= \( buildDir. path) " ,
230
- " -sdk " , platform. rawValue,
231
- " OTHER_CFLAGS=$(value) \( distributionFlag) " ]
232
- let args = standardOptions + platform. extraArguments ( )
223
+ let platformSpecificFlags = platform. otherCFlags ( ) . joined ( separator: " " )
224
+ let cFlags = " OTHER_CFLAGS=$(value) \( distributionFlag) \( platformSpecificFlags) "
225
+ let args = [ " build " ,
226
+ " -configuration " , " release " ,
227
+ " -workspace " , workspacePath,
228
+ " -scheme " , framework,
229
+ " GCC_GENERATE_DEBUGGING_SYMBOLS=No " ,
230
+ " ARCHS= \( arch. rawValue) " ,
231
+ " BUILD_DIR= \( buildDir. path) " ,
232
+ " -sdk " , platform. rawValue,
233
+ cFlags]
233
234
print ( """
234
235
Compiling \( framework) for \( arch. rawValue) with command:
235
236
/usr/bin/xcodebuild \( args. joined ( separator: " " ) )
@@ -418,7 +419,7 @@ struct FrameworkBuilder {
418
419
419
420
// Verify Firebase headers include an explicit umbrella header for Firebase.h.
420
421
let headersDir = podsDir. appendingPathComponents ( [ " Headers " , " Public " , framework] )
421
- if framework. hasPrefix ( " Firebase " ) && framework != " FirebaseCoreDiagnostics " {
422
+ if framework. hasPrefix ( " Firebase " ) , framework != " FirebaseCoreDiagnostics " {
422
423
let frameworkHeader = headersDir. appendingPathComponent ( " \( framework) .h " )
423
424
guard fileManager. fileExists ( atPath: frameworkHeader. path) else {
424
425
fatalError ( " Missing explicit umbrella header for \( framework) . " )
0 commit comments