@@ -15,7 +15,10 @@ def build_for_iosish_platform(sandbox,
1515 target ,
1616 device ,
1717 simulator ,
18- bitcode_enabled )
18+ bitcode_enabled ,
19+ custom_build_options = [ ] , # Array<string>
20+ custom_build_options_simulator = [ ] # Array<string>
21+ )
1922
2023 deployment_target = target . platform . deployment_target . to_s
2124
@@ -26,8 +29,9 @@ def build_for_iosish_platform(sandbox,
2629 if bitcode_enabled
2730 other_options += [ 'BITCODE_GENERATION_MODE=bitcode' ]
2831 end
29- xcodebuild ( sandbox , target_label , device , deployment_target , other_options )
30- xcodebuild ( sandbox , target_label , simulator , deployment_target , other_options + [ 'ARCHS=x86_64' , 'ONLY_ACTIVE_ARCH=NO' ] )
32+
33+ xcodebuild ( sandbox , target_label , device , deployment_target , other_options + custom_build_options )
34+ xcodebuild ( sandbox , target_label , simulator , deployment_target , other_options + [ 'ARCHS=x86_64' , 'ONLY_ACTIVE_ARCH=NO' ] + custom_build_options_simulator )
3135
3236 # paths
3337 root_name = target . pod_name
@@ -94,7 +98,7 @@ class Prebuild
9498 # [Pathname] output_path
9599 # output path for generated frameworks
96100 #
97- def self . build ( sandbox_root_path , target , output_path , bitcode_enabled = false )
101+ def self . build ( sandbox_root_path , target , output_path , bitcode_enabled = false , custom_build_options = [ ] , custom_build_options_simulator = [ ] )
98102
99103 return unless not target == nil
100104
@@ -104,8 +108,8 @@ def self.build(sandbox_root_path, target, output_path, bitcode_enabled = false)
104108
105109 # -- build the framework
106110 case target . platform . name
107- when :ios then build_for_iosish_platform ( sandbox , build_dir , output_path , target , 'iphoneos' , 'iphonesimulator' , bitcode_enabled )
108- when :osx then xcodebuild ( sandbox , target . label )
111+ when :ios then build_for_iosish_platform ( sandbox , build_dir , output_path , target , 'iphoneos' , 'iphonesimulator' , bitcode_enabled , custom_build_options , custom_build_options_simulator )
112+ when :osx then xcodebuild ( sandbox , target . label , 'macosx' , nil , custom_build_options )
109113 # when :tvos then build_for_iosish_platform(sandbox, build_dir, target, 'appletvos', 'appletvsimulator')
110114 # when :watchos then build_for_iosish_platform(sandbox, build_dir, target, 'watchos', 'watchsimulator')
111115 else raise "Unsupported platform for '#{ target . name } ': '#{ target . platform . name } '" end
0 commit comments