Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue with IRGen #134

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion lib/cocoapods-binary/Prebuild.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,14 @@ def prebuild_frameworks!

output_path = sandbox.framework_folder_path_for_target_name(target.name)
output_path.mkpath unless output_path.exist?
Pod::Prebuild.build(sandbox_path, target, output_path, bitcode_enabled, Podfile::DSL.custom_build_options, Podfile::DSL.custom_build_options_simulator)

min_deployment_target = aggregate_targets
.select { |t| t.pod_targets.include?(target) }
.map(&:platform)
.map(&:deployment_target)
.max

Pod::Prebuild.build(sandbox_path, target, min_deployment_target, output_path, bitcode_enabled, Podfile::DSL.custom_build_options, Podfile::DSL.custom_build_options_simulator)

# save the resource paths for later installing
if target.static_framework? and !target.resource_paths.empty?
Expand Down
25 changes: 12 additions & 13 deletions lib/cocoapods-binary/rome/build_framework.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,18 @@
# @param [PodTarget] target
# a specific pod target
#
def build_for_iosish_platform(sandbox,
build_dir,
def build_for_iosish_platform(sandbox,
build_dir,
output_path,
target,
device,
target,
deployment_target,
device,
simulator,
bitcode_enabled,
custom_build_options = [], # Array<String>
custom_build_options_simulator = [] # Array<String>
)

deployment_target = target.platform.deployment_target.to_s

target_label = target.label # name with platform if it's used in multiple platforms
Pod::UI.puts "Prebuilding #{target_label}..."

Expand All @@ -46,14 +45,14 @@ def build_for_iosish_platform(sandbox,
device_binary = device_framework_path + "/#{module_name}"
simulator_binary = simulator_framework_path + "/#{module_name}"
return unless File.file?(device_binary) && File.file?(simulator_binary)

# the device_lib path is the final output file path
# combine the binaries
tmp_lipoed_binary_path = "#{build_dir}/#{target_name}"
lipo_log = `lipo -create -output #{tmp_lipoed_binary_path} #{device_binary} #{simulator_binary}`
puts lipo_log unless File.exist?(tmp_lipoed_binary_path)
Pod::UI.puts lipo_log unless File.exist?(tmp_lipoed_binary_path)
FileUtils.mv tmp_lipoed_binary_path, device_binary, :force => true

# collect the swiftmodule file for various archs.
device_swiftmodule_path = device_framework_path + "/Modules/#{module_name}.swiftmodule"
simulator_swiftmodule_path = simulator_framework_path + "/Modules/#{module_name}.swiftmodule"
Expand Down Expand Up @@ -127,7 +126,7 @@ def xcodebuild(sandbox, target, sdk='macosx', deployment_target=nil, other_optio
raise "shouldn't be handle by xcpretty"
end
rescue
puts log.red
Pod::UI.puts log.red
end
end
[is_succeed, log]
Expand All @@ -149,7 +148,7 @@ class Prebuild
# [Pathname] output_path
# output path for generated frameworks
#
def self.build(sandbox_root_path, target, output_path, bitcode_enabled = false, custom_build_options=[], custom_build_options_simulator=[])
def self.build(sandbox_root_path, target, min_deployment_target, output_path, bitcode_enabled = false, custom_build_options=[], custom_build_options_simulator=[])

return if target.nil?

Expand All @@ -159,7 +158,7 @@ def self.build(sandbox_root_path, target, output_path, bitcode_enabled = false,

# -- build the framework
case target.platform.name
when :ios then build_for_iosish_platform(sandbox, build_dir, output_path, target, 'iphoneos', 'iphonesimulator', bitcode_enabled, custom_build_options, custom_build_options_simulator)
when :ios then build_for_iosish_platform(sandbox, build_dir, output_path, target, min_deployment_target, 'iphoneos', 'iphonesimulator', bitcode_enabled, custom_build_options, custom_build_options_simulator)
when :osx then xcodebuild(sandbox, target.label, 'macosx', nil, custom_build_options)
# when :tvos then build_for_iosish_platform(sandbox, build_dir, target, 'appletvos', 'appletvsimulator')
when :watchos then build_for_iosish_platform(sandbox, build_dir, output_path, target, 'watchos', 'watchsimulator', true, custom_build_options, custom_build_options_simulator)
Expand Down Expand Up @@ -188,7 +187,7 @@ def self.build(sandbox_root_path, target, output_path, bitcode_enabled = false,

def self.remove_build_dir(sandbox_root)
path = build_dir(sandbox_root)
path.rmtree if path.exist?
# path.rmtree if path.exist?
end

private
Expand Down