Commit 0d918ae8 authored by Marius Rackwitz's avatar Marius Rackwitz

[Installer] Fix architecture determination

parent ac87bcf3
......@@ -369,7 +369,7 @@ module Pod
if config.integrate_targets?
target_inspections = result.target_inspections.select { |t, _| target_definitions.include?(t) }.values
pod_target.user_build_configurations = target_inspections.map(&:build_configurations).reduce({}, &:merge)
pod_target.archs = target_inspections.map(&:archs).uniq.sort
pod_target.archs = target_inspections.flat_map(&:archs).compact.uniq.sort
else
pod_target.user_build_configurations = {}
if target_definitions.first.platform.name == :osx
......@@ -651,7 +651,10 @@ module Pod
inspection_result = {}
UI.section 'Inspecting targets to integrate' do
podfile.target_definition_list.each do |target_definition|
inspection_result[target_definition] = TargetInspector.new(target_definition).inspect!
results = TargetInspector.new(target_definition).inspect!
inspection_result[target_definition] = results
UI.message('Using `ARCHS` setting to build architectures of ' \
"target `#{target_definition.label}`: (`#{results.archs.join('`, `')}`)")
end
end
inspection_result
......
......@@ -155,14 +155,9 @@ module Pod
# @return [Array<String>]
#
def compute_archs(user_targets)
archs = user_targets.flat_map do |target|
user_targets.flat_map do |target|
Array(target.common_resolved_build_setting('ARCHS'))
end.compact.uniq.sort
UI.message('Using `ARCHS` setting to build architectures of ' \
"target `#{target_definition.label}`: " \
"(`#{archs.join('`, `')}`)")
archs.length > 1 ? archs : archs.first
end
# Checks if any of the targets for the {TargetDefinition} computed before
......
......@@ -67,7 +67,7 @@ module Pod
def custom_build_settings
settings = {}
if target.archs
unless target.nil? || target.archs.empty?
settings['ARCHS'] = target.archs
end
......
......@@ -152,7 +152,7 @@ module Pod
user_targets = [target]
archs = TargetInspector.new(target_definition).send(:compute_archs, user_targets)
archs.should == 'armv7'
archs.should == %w(armv7)
end
it 'handles a single ARCH defined in multiple user targets' do
......@@ -167,7 +167,7 @@ module Pod
user_targets = [targeta, targetb]
archs = TargetInspector.new(target_definition).send(:compute_archs, user_targets)
archs.should == 'armv7'
archs.should == %w(armv7)
end
it 'handles an Array of ARCHs defined in a single user target' do
......
......@@ -100,6 +100,8 @@ module Pod
].sort
target.support_files_dir.should == config.sandbox.target_support_files_dir('Pods')
target.pod_targets.map(&:archs).uniq.should == [[]]
target.user_project_path.to_s.should.include 'SampleProject/SampleProject'
target.client_root.to_s.should.include 'SampleProject'
target.user_target_uuids.should == ['A346496C14F9BE9A0080D870']
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment