Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(334)

Side by Side Diff: build/config/ios/rules.gni

Issue 2326543003: Add missing linker flags to allow use of custom frameworks on iOS. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import("//build/config/ios/ios_sdk.gni") 5 import("//build/config/ios/ios_sdk.gni")
6 import("//build/config/mac/base_rules.gni") 6 import("//build/config/mac/base_rules.gni")
7 import("//build/config/mac/symbols.gni") 7 import("//build/config/mac/symbols.gni")
8 8
9 # Invokes lipo on multiple arch-specific binaries to create a fat binary. 9 # Invokes lipo on multiple arch-specific binaries to create a fat binary.
10 # 10 #
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 if (!defined(deps)) { 432 if (!defined(deps)) {
433 deps = [] 433 deps = []
434 } 434 }
435 deps += [ ":$_arch_executable_source" ] 435 deps += [ ":$_arch_executable_source" ]
436 436
437 if (!defined(libs)) { 437 if (!defined(libs)) {
438 libs = [] 438 libs = []
439 } 439 }
440 libs += [ "UIKit.framework" ] 440 libs += [ "UIKit.framework" ]
441 441
442 if (!defined(ldflags)) {
443 ldflags = []
444 }
445 ldflags += [
446 "-Xlinker",
447 "-rpath",
448 "-Xlinker",
449 "@executable_path/Frameworks",
450 "-Xlinker",
451 "-objc_abi_version",
452 "-Xlinker",
453 "2",
454 ]
455
442 if (use_ios_simulator) { 456 if (use_ios_simulator) {
443 deps += [ ":$_generate_entitlements_target($default_toolchain)" ] 457 deps += [ ":$_generate_entitlements_target($default_toolchain)" ]
444 458
445 if (!defined(inputs)) { 459 if (!defined(inputs)) {
446 inputs = [] 460 inputs = []
447 } 461 }
448 inputs += [ _generate_entitlements_output ] 462 inputs += [ _generate_entitlements_output ]
449 463
450 if (!defined(ldflags)) { 464 if (!defined(ldflags)) {
451 ldflags = [] 465 ldflags = []
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
858 _output_name = invoker.output_name 872 _output_name = invoker.output_name
859 } 873 }
860 874
861 _has_public_headers = 875 _has_public_headers =
862 defined(invoker.public_headers) && invoker.public_headers != [] 876 defined(invoker.public_headers) && invoker.public_headers != []
863 877
864 if (_has_public_headers) { 878 if (_has_public_headers) {
865 _framework_headers_target = _target_name + "_framework_headers" 879 _framework_headers_target = _target_name + "_framework_headers"
866 _framework_headers_config = _target_name + "_framework_headers_config" 880 _framework_headers_config = _target_name + "_framework_headers_config"
867 _headers_map_config = _target_name + "_headers_map" 881 _headers_map_config = _target_name + "_headers_map"
868 _install_name_config = _target_name + "_install_name"
869 } 882 }
870 883
871 _arch_shared_library_source = _target_name + "_arch_shared_library_sources" 884 _arch_shared_library_source = _target_name + "_arch_shared_library_sources"
872 _arch_shared_library_target = _target_name + "_arch_shared_library" 885 _arch_shared_library_target = _target_name + "_arch_shared_library"
873 _lipo_shared_library_target = _target_name + "_shared_library" 886 _lipo_shared_library_target = _target_name + "_shared_library"
874 887
875 source_set(_arch_shared_library_source) { 888 source_set(_arch_shared_library_source) {
876 forward_variables_from(invoker, 889 forward_variables_from(invoker,
877 "*", 890 "*",
878 [ 891 [
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
918 931
919 visibility = [ ":$_lipo_shared_library_target($default_toolchain)" ] 932 visibility = [ ":$_lipo_shared_library_target($default_toolchain)" ]
920 if (current_toolchain != default_toolchain) { 933 if (current_toolchain != default_toolchain) {
921 visibility += [ ":$_target_name" ] 934 visibility += [ ":$_target_name" ]
922 } 935 }
923 936
924 if (!defined(deps)) { 937 if (!defined(deps)) {
925 deps = [] 938 deps = []
926 } 939 }
927 deps += [ ":$_arch_shared_library_source" ] 940 deps += [ ":$_arch_shared_library_source" ]
928 configs += [ ":$_install_name_config($default_toolchain)" ] 941
942 if (!defined(ldflags)) {
943 ldflags = []
944 }
945 ldflags += [
946 "-Xlinker",
947 "-install_name",
948 "-Xlinker",
949 "@rpath/$_output_name.framework/$_output_name",
950 "-Xlinker",
951 "-objc_abi_version",
952 "-Xlinker",
953 "2",
954 ]
929 955
930 output_extension = "" 956 output_extension = ""
931 output_name = _output_name 957 output_name = _output_name
932 output_prefix_override = true 958 output_prefix_override = true
933 output_dir = "$target_out_dir/$current_cpu" 959 output_dir = "$target_out_dir/$current_cpu"
934 } 960 }
935 961
936 if (current_toolchain != default_toolchain) { 962 if (current_toolchain != default_toolchain) {
937 # For fat builds, only the default toolchain will generate a framework 963 # For fat builds, only the default toolchain will generate a framework
938 # bundle. For the other toolchains, the template is only used for building 964 # bundle. For the other toolchains, the template is only used for building
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
1015 outputs = [ 1041 outputs = [
1016 "$_framework_root/Headers/{{source_file_part}}", 1042 "$_framework_root/Headers/{{source_file_part}}",
1017 ] 1043 ]
1018 } 1044 }
1019 1045
1020 config(_headers_map_config) { 1046 config(_headers_map_config) {
1021 visibility = [ ":$_target_name" ] 1047 visibility = [ ":$_target_name" ]
1022 include_dirs = [ _header_map_filename ] 1048 include_dirs = [ _header_map_filename ]
1023 } 1049 }
1024 1050
1025 config(_install_name_config) {
1026 visibility = [ ":$_target_name" ]
1027 ldflags = [
1028 "-install_name",
1029 "@rpath/$_output_name.framework/$_output_name",
1030 ]
1031 }
1032
1033 group(_framework_headers_target) { 1051 group(_framework_headers_target) {
1034 deps = [ 1052 deps = [
1035 ":$_compile_headers_map_target", 1053 ":$_compile_headers_map_target",
1036 ":$_copy_public_headers_target", 1054 ":$_copy_public_headers_target",
1037 ":$_create_module_map_target", 1055 ":$_create_module_map_target",
1038 ] 1056 ]
1039 } 1057 }
1040 1058
1041 config(_framework_headers_config) { 1059 config(_framework_headers_config) {
1042 # The link settings are inherited from the framework_bundle config. 1060 # The link settings are inherited from the framework_bundle config.
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
1323 "-rpath", 1341 "-rpath",
1324 "-Xlinker", 1342 "-Xlinker",
1325 "@loader_path/Frameworks", 1343 "@loader_path/Frameworks",
1326 ] 1344 ]
1327 } 1345 }
1328 } 1346 }
1329 1347
1330 set_defaults("ios_xctest_test") { 1348 set_defaults("ios_xctest_test") {
1331 configs = default_executable_configs 1349 configs = default_executable_configs
1332 } 1350 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698