@@ -23,32 +23,6 @@ enum Architecture: String, CaseIterable {
23
23
case device = " iphoneos "
24
24
case simulator = " iphonesimulator "
25
25
case catalyst = " macosx "
26
-
27
- /// Extra C flags that should be included as part of the build process for each target platform.
28
- func otherCFlags( ) -> [ String ] {
29
- switch self {
30
- case . device:
31
- // For device, we want to enable bitcode.
32
- return [ " -fembed-bitcode " ]
33
- default :
34
- // No extra arguments are required for simulator builds.
35
- return [ ]
36
- }
37
- }
38
-
39
- /// Arguments that should be included as part of the build process for each target platform.
40
- func extraArguments( ) -> [ String ] {
41
- let base = [ " -sdk " , rawValue]
42
- switch self {
43
- case . catalyst:
44
- return [ " SKIP_INSTALL=NO " ,
45
- " BUILD_LIBRARIES_FOR_DISTRIBUTION=YES " ,
46
- " SUPPORTS_UIKITFORMAC=YES " ]
47
- case . simulator, . device:
48
- // No extra arguments are required for simulator or device builds.
49
- return base
50
- }
51
- }
52
26
}
53
27
54
28
case arm64
@@ -242,8 +216,7 @@ struct FrameworkBuilder {
242
216
let platformFolder = isMacCatalyst ? " maccatalyst " : platform. rawValue
243
217
let workspacePath = projectDir. appendingPathComponent ( " FrameworkMaker.xcworkspace " ) . path
244
218
let distributionFlag = carthageBuild ? " -DFIREBASE_BUILD_CARTHAGE " : " -DFIREBASE_BUILD_ZIP_FILE "
245
- let platformSpecificFlags = platform. otherCFlags ( ) . joined ( separator: " " )
246
- let cFlags = " OTHER_CFLAGS=$(value) \( distributionFlag) \( platformSpecificFlags) "
219
+ let cFlags = " OTHER_CFLAGS=$(value) \( distributionFlag) "
247
220
let cleanArch = isMacCatalyst ? Architecture . x86_64. rawValue : archs. map { $0. rawValue }
248
221
. joined ( separator: " " )
249
222
@@ -265,6 +238,10 @@ struct FrameworkBuilder {
265
238
" BUILD_DIR= \( buildDir. path) " ,
266
239
" -sdk " , platform. rawValue,
267
240
cFlags]
241
+ // Add bitcode option for devices.
242
+ if platform. self == . device {
243
+ args. append ( " BITCODE_GENERATION_MODE=bitcode " )
244
+ }
268
245
// Code signing isn't needed for libraries. Disabling signing is required for
269
246
// Catalyst libs with resources. See
270
247
// https://github.com/CocoaPods/CocoaPods/issues/8891#issuecomment-573301570
0 commit comments