Commit ba8574b4 authored by sdefresne's avatar sdefresne Committed by Commit bot

Add missing linker flags to allow use of custom frameworks on iOS.

Pass required flags "-rpath @executable/Frameworks" when linking
executable to point to the location where the custom frameworks
are located in iOS builds.

Pass flags "-objc_abi_version 2" to linker flag for execuable and
dynamic libraries as is done by Xcode and remove one intermediate
config object (unnecessary).

BUG=None

Review-Url: https://codereview.chromium.org/2326543003
Cr-Commit-Position: refs/heads/master@{#417403}
parent 81c6985d
......@@ -439,6 +439,20 @@ template("ios_app_bundle") {
}
libs += [ "UIKit.framework" ]
if (!defined(ldflags)) {
ldflags = []
}
ldflags += [
"-Xlinker",
"-rpath",
"-Xlinker",
"@executable_path/Frameworks",
"-Xlinker",
"-objc_abi_version",
"-Xlinker",
"2",
]
if (use_ios_simulator) {
deps += [ ":$_generate_entitlements_target($default_toolchain)" ]
......@@ -865,7 +879,6 @@ template("ios_framework_bundle") {
_framework_headers_target = _target_name + "_framework_headers"
_framework_headers_config = _target_name + "_framework_headers_config"
_headers_map_config = _target_name + "_headers_map"
_install_name_config = _target_name + "_install_name"
}
_arch_shared_library_source = _target_name + "_arch_shared_library_sources"
......@@ -925,7 +938,20 @@ template("ios_framework_bundle") {
deps = []
}
deps += [ ":$_arch_shared_library_source" ]
configs += [ ":$_install_name_config($default_toolchain)" ]
if (!defined(ldflags)) {
ldflags = []
}
ldflags += [
"-Xlinker",
"-install_name",
"-Xlinker",
"@rpath/$_output_name.framework/$_output_name",
"-Xlinker",
"-objc_abi_version",
"-Xlinker",
"2",
]
output_extension = ""
output_name = _output_name
......@@ -1022,14 +1048,6 @@ template("ios_framework_bundle") {
include_dirs = [ _header_map_filename ]
}
config(_install_name_config) {
visibility = [ ":$_target_name" ]
ldflags = [
"-install_name",
"@rpath/$_output_name.framework/$_output_name",
]
}
group(_framework_headers_target) {
deps = [
":$_compile_headers_map_target",
......
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