Commit 1e749bb8 authored by Joachim Bengtsson's avatar Joachim Bengtsson Committed by Eloy Durán

[installer] link using LDFLAGS instead of product reference

Since we want to do conditional linking, the list of Pods to link with 
needs to be provided by an xcconfig file. Only way to do that is to
remove the linking responsibility from Xcode and give it to ld directly.
parent 1fdce609
......@@ -67,6 +67,11 @@ module Pod
XCConfigHelper.add_library_build_settings(vendored_library, @xcconfig, target.sandbox.root)
end
end
# This is how the Pods project now links with dependencies, instead of a "Link with Libraries" build phase
@xcconfig.merge!({
'OTHER_LDFLAGS' => "-l#{pod_target.name}"
})
end
# TODO Need to decide how we are going to ensure settings like these
......
......@@ -114,7 +114,7 @@ module Pod
install_file_references
install_libraries
set_target_dependencies
link_aggregate_target
# note: linking with pod libraries is now done by aggregate_xcconfig's OTHER_LDFLAGS
run_post_install_hooks
write_pod_project
write_lockfiles
......@@ -379,21 +379,6 @@ module Pod
end
end
# Links the aggregate targets with all the dependent libraries.
#
# @note This is run in the integration step to ensure that targets
# have been created for all per spec libraries.
#
def link_aggregate_target
aggregate_targets.each do |aggregate_target|
native_target = aggregate_target.target
aggregate_target.pod_targets.each do |pod_target|
product = pod_target.target.product_reference
native_target.frameworks_build_phase.add_file_reference(product)
end
end
end
# Writes the Pods project to the disk.
#
# @return [void]
......
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