| OLD | NEW | 
|     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 # Generates Info.plist files for Mac apps and frameworks. |     9 # Generates Info.plist files for Mac apps and frameworks. | 
|    10 # |    10 # | 
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   203       sources = get_target_outputs(":$_generate_info_plist") |   203       sources = get_target_outputs(":$_generate_info_plist") | 
|   204       outputs = [ |   204       outputs = [ | 
|   205         "{{bundle_root_dir}}/Info.plist", |   205         "{{bundle_root_dir}}/Info.plist", | 
|   206       ] |   206       ] | 
|   207       public_deps = [ |   207       public_deps = [ | 
|   208         ":$_generate_info_plist", |   208         ":$_generate_info_plist", | 
|   209       ] |   209       ] | 
|   210     } |   210     } | 
|   211  |   211  | 
|   212     _link_executable = _target_name + "_executable" |   212     _link_executable = _target_name + "_executable" | 
|   213     _executable_path = "$target_out_dir/$_output_name" |  | 
|   214  |   213  | 
|   215     if (ios_enable_code_signing) { |   214     if (ios_enable_code_signing) { | 
|   216       _link_executable_visibility = [ ":$_target_name" ] |   215       _link_executable_visibility = [ ":$_target_name" ] | 
|   217     } else { |   216     } else { | 
|   218       _bundle_data_executable = target_name + "_bundle_data_executable" |   217       _bundle_data_executable = target_name + "_bundle_data_executable" | 
|   219       _link_executable_visibility = [ ":$_bundle_data_executable" ] |   218       _link_executable_visibility = [ ":$_bundle_data_executable" ] | 
|   220     } |   219     } | 
|   221  |   220  | 
|   222     # For a fat-build, the different "executable" outputs will be used to |   221     # For a fat-build, the different "executable" outputs will be used to | 
|   223     # create the final binary using "lipo". As the corresponding target has |   222     # create the final binary using "lipo". As the corresponding target has | 
|   224     # the same role as the "executable" target in a thin build, copy the |   223     # the same role as the "executable" target in a thin build, copy the | 
|   225     # visibility and redefine some variables. |   224     # visibility and redefine some variables. | 
|   226     if (_is_fat_build) { |   225     if (_is_fat_build) { | 
|   227       _lipo_executable = _link_executable |   226       _lipo_executable = _link_executable | 
|   228       _lipo_executable_visibility = _link_executable_visibility |   227       _lipo_executable_visibility = _link_executable_visibility | 
|   229  |   228  | 
|   230       _link_executable_visibility = [] |   229       _link_executable_visibility = [] | 
|   231       _link_executable_visibility = [ ":$_lipo_executable" ] |   230       _link_executable_visibility = [ ":$_lipo_executable" ] | 
|   232       _link_executable = _target_name + "_arch_executable" |   231       _link_executable = _target_name + "_arch_executable" | 
|   233  |  | 
|   234       _arch_executable_path = "$target_out_dir/$current_cpu/$_output_name" |  | 
|   235     } |   232     } | 
|   236  |   233  | 
|   237     executable(_link_executable) { |   234     executable(_link_executable) { | 
|   238       forward_variables_from(invoker, |   235       forward_variables_from(invoker, | 
|   239                              "*", |   236                              "*", | 
|   240                              [ |   237                              [ | 
|   241                                "bundle_deps", |   238                                "bundle_deps", | 
|   242                                "bundle_extension", |   239                                "bundle_extension", | 
|   243                                "extra_system_frameworks", |   240                                "extra_system_frameworks", | 
|   244                                "data_deps", |   241                                "data_deps", | 
|   245                                "entitlements_path", |   242                                "entitlements_path", | 
|   246                                "extra_substitutions", |   243                                "extra_substitutions", | 
|   247                                "info_plist", |   244                                "info_plist", | 
|   248                                "info_plist_target", |   245                                "info_plist_target", | 
|   249                                "output_name", |   246                                "output_name", | 
|   250                                "product_type", |   247                                "product_type", | 
|   251                                "visibility", |   248                                "visibility", | 
|   252                              ]) |   249                              ]) | 
|   253  |   250  | 
|   254       visibility = _link_executable_visibility |   251       visibility = _link_executable_visibility | 
|   255  |   252  | 
 |   253       output_name = _output_name | 
|   256       output_prefix_override = true |   254       output_prefix_override = true | 
|   257       if (_is_fat_build) { |   255       if (_is_fat_build) { | 
|   258         output_name = rebase_path(_arch_executable_path, root_build_dir) |   256         output_dir = "$target_out_dir/$current_cpu" | 
|   259       } else { |   257       } else { | 
|   260         output_name = rebase_path(_executable_path, root_build_dir) |   258         output_dir = target_out_dir | 
|   261       } |   259       } | 
|   262  |   260  | 
|   263       if (!defined(libs)) { |   261       if (!defined(libs)) { | 
|   264         libs = [] |   262         libs = [] | 
|   265       } |   263       } | 
|   266       libs += [ "UIKit.framework" ] |   264       libs += [ "UIKit.framework" ] | 
|   267     } |   265     } | 
|   268  |   266  | 
|   269     if (_is_fat_build) { |   267     if (_is_fat_build) { | 
|   270       # Create the multi-architecture binary from all the single architecture |   268       # Create the multi-architecture binary from all the single architecture | 
|   271       # binaries using "lipo". This target exists for the default toolchain |   269       # binaries using "lipo". This target exists for the default toolchain | 
|   272       # of a fat-build only and depends on the expansion of "ios_app_bundle" |   270       # of a fat-build only and depends on the expansion of "ios_app_bundle" | 
|   273       # for the other toolchains (i.e. a single "executable" target). |   271       # for the other toolchains (i.e. a single "executable" target). | 
|   274       # |   272       # | 
|   275       # This action only happens once per "ios_app_bundle" template (for the |   273       # This action only happens once per "ios_app_bundle" template (for the | 
|   276       # main toolchain). |   274       # main toolchain). | 
|   277       action(_lipo_executable) { |   275       action(_lipo_executable) { | 
|   278         forward_variables_from(invoker, [ "testonly" ]) |   276         forward_variables_from(invoker, [ "testonly" ]) | 
|   279         visibility = _lipo_executable_visibility |   277         visibility = _lipo_executable_visibility | 
|   280         script = "//build/toolchain/mac/linker_driver.py" |   278         script = "//build/toolchain/mac/linker_driver.py" | 
|   281         outputs = [ |   279         outputs = [ | 
|   282           _executable_path, |   280           "$target_out_dir/$_output_name", | 
|   283         ] |   281         ] | 
|   284         inputs = [ |   282         inputs = [ | 
|   285           _arch_executable_path, |   283           "$target_out_dir/$current_cpu/$_output_name", | 
|   286         ] |   284         ] | 
|   287         deps = [ |   285         deps = [ | 
|   288           ":$_link_executable", |   286           ":$_link_executable", | 
|   289         ] |   287         ] | 
|   290         foreach(_additional_toolchain, additional_toolchains) { |   288         foreach(_additional_toolchain, additional_toolchains) { | 
|   291           _additional_toolchain_target = "$_target_name($_additional_toolchain)" |   289           _additional_toolchain_target = "$_target_name($_additional_toolchain)" | 
|   292           deps += [ ":$_additional_toolchain_target" ] |   290           deps += [ ":$_additional_toolchain_target" ] | 
|   293           inputs += [ get_label_info(_additional_toolchain_target, |   291           inputs += [ get_label_info(_additional_toolchain_target, | 
|   294                                      "root_out_dir") + "/$_output_name" ] |   292                                      "root_out_dir") + "/$_output_name" ] | 
|   295         } |   293         } | 
| (...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   986       public_deps = [ |   984       public_deps = [ | 
|   987         ":$_xctest_info_plist_target", |   985         ":$_xctest_info_plist_target", | 
|   988       ] |   986       ] | 
|   989       sources = get_target_outputs(":$_xctest_info_plist_target") |   987       sources = get_target_outputs(":$_xctest_info_plist_target") | 
|   990       outputs = [ |   988       outputs = [ | 
|   991         "{{bundle_root_dir}}/Info.plist", |   989         "{{bundle_root_dir}}/Info.plist", | 
|   992       ] |   990       ] | 
|   993     } |   991     } | 
|   994  |   992  | 
|   995     _xctest_loadable_module_target = _xctest_target + "_loadable_module" |   993     _xctest_loadable_module_target = _xctest_target + "_loadable_module" | 
|   996     _xctest_loadable_module_path = "$target_out_dir/$_xctest_output" |  | 
|   997  |   994  | 
|   998     if (!ios_enable_code_signing) { |   995     if (!ios_enable_code_signing) { | 
|   999       _xctest_loadable_module_bundle = |   996       _xctest_loadable_module_bundle = | 
|  1000           _xctest_target + "_loadable_module_bundle" |   997           _xctest_target + "_loadable_module_bundle" | 
|  1001       _xctest_loadable_module_visibility = |   998       _xctest_loadable_module_visibility = | 
|  1002           [ ":$_xctest_loadable_module_bundle" ] |   999           [ ":$_xctest_loadable_module_bundle" ] | 
|  1003     } else { |  1000     } else { | 
|  1004       _xctest_loadable_module_visibility = [ ":$_xctest_target" ] |  1001       _xctest_loadable_module_visibility = [ ":$_xctest_target" ] | 
|  1005     } |  1002     } | 
|  1006  |  1003  | 
|  1007     if (_is_fat_build) { |  1004     if (_is_fat_build) { | 
|  1008       _xctest_lipo_loadable_module_target = _xctest_loadable_module_target |  1005       _xctest_lipo_loadable_module_target = _xctest_loadable_module_target | 
|  1009       _xctest_lipo_loadable_module_visibility = |  1006       _xctest_lipo_loadable_module_visibility = | 
|  1010           _xctest_loadable_module_visibility |  1007           _xctest_loadable_module_visibility | 
|  1011       _arch_xctest_loadable_module_path = |  | 
|  1012           "$target_out_dir/$current_cpu/$_xctest_output" |  | 
|  1013  |  1008  | 
|  1014       _xctest_loadable_module_visibility = [] |  1009       _xctest_loadable_module_visibility = [] | 
|  1015       _xctest_loadable_module_visibility = |  1010       _xctest_loadable_module_visibility = | 
|  1016           [ ":$_xctest_lipo_loadable_module_target" ] |  1011           [ ":$_xctest_lipo_loadable_module_target" ] | 
|  1017       _xctest_loadable_module_target = _xctest_target + "_arch_loadable_module" |  1012       _xctest_loadable_module_target = _xctest_target + "_arch_loadable_module" | 
|  1018     } |  1013     } | 
|  1019  |  1014  | 
|  1020     loadable_module(_xctest_loadable_module_target) { |  1015     loadable_module(_xctest_loadable_module_target) { | 
|  1021       visibility = _xctest_loadable_module_visibility |  1016       visibility = _xctest_loadable_module_visibility | 
|  1022       sources = [ |  1017       sources = [ | 
|  1023         "//build/config/ios/xctest_shell.mm", |  1018         "//build/config/ios/xctest_shell.mm", | 
|  1024       ] |  1019       ] | 
|  1025       configs += [ "//build/config/ios:xctest_config" ] |  1020       configs += [ "//build/config/ios:xctest_config" ] | 
|  1026  |  1021  | 
|  1027       if (_is_fat_build) { |  1022       if (_is_fat_build) { | 
|  1028         output_name = |  1023         output_dir = "$target_out_dir/$current_cpu" | 
|  1029             rebase_path(_arch_xctest_loadable_module_path, root_out_dir) |  | 
|  1030       } else { |  1024       } else { | 
|  1031         output_name = rebase_path(_xctest_loadable_module_path, root_out_dir) |  1025         output_dir = target_out_dir | 
|  1032       } |  1026       } | 
|  1033  |  1027  | 
 |  1028       output_name = _xctest_output | 
|  1034       output_prefix_override = true |  1029       output_prefix_override = true | 
|  1035       output_extension = "" |  1030       output_extension = "" | 
|  1036     } |  1031     } | 
|  1037  |  1032  | 
|  1038     if (_is_fat_build) { |  1033     if (_is_fat_build) { | 
|  1039       action(_xctest_lipo_loadable_module_target) { |  1034       action(_xctest_lipo_loadable_module_target) { | 
|  1040         visibility = _xctest_lipo_loadable_module_visibility |  1035         visibility = _xctest_lipo_loadable_module_visibility | 
|  1041         script = "//build/toolchain/mac/linker_driver.py" |  1036         script = "//build/toolchain/mac/linker_driver.py" | 
|  1042         outputs = [ |  1037         outputs = [ | 
|  1043           _xctest_loadable_module_path, |  1038           "$target_out_dir/$_xctest_output", | 
|  1044         ] |  1039         ] | 
|  1045         inputs = [ |  1040         inputs = [ | 
|  1046           _arch_xctest_loadable_module_path, |  1041           "$target_out_dir/$current_cpu/$_xctest_output", | 
|  1047         ] |  1042         ] | 
|  1048         deps = [ |  1043         deps = [ | 
|  1049           ":$_xctest_loadable_module_target", |  1044           ":$_xctest_loadable_module_target", | 
|  1050         ] |  1045         ] | 
|  1051         foreach(_additional_toolchain, additional_toolchains) { |  1046         foreach(_additional_toolchain, additional_toolchains) { | 
|  1052           _additional_toolchain_target = "$_target_name($_additional_toolchain)" |  1047           _additional_toolchain_target = "$_target_name($_additional_toolchain)" | 
|  1053           deps += [ ":$_additional_toolchain_target" ] |  1048           deps += [ ":$_additional_toolchain_target" ] | 
|  1054           inputs += [ get_label_info(_additional_toolchain_target, |  1049           inputs += [ get_label_info(_additional_toolchain_target, | 
|  1055                                      "root_out_dir") + "/$_xctest_output" ] |  1050                                      "root_out_dir") + "/$_xctest_output" ] | 
|  1056         } |  1051         } | 
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1209       "-rpath", |  1204       "-rpath", | 
|  1210       "-Xlinker", |  1205       "-Xlinker", | 
|  1211       "@loader_path/Frameworks", |  1206       "@loader_path/Frameworks", | 
|  1212     ] |  1207     ] | 
|  1213   } |  1208   } | 
|  1214 } |  1209 } | 
|  1215  |  1210  | 
|  1216 set_defaults("ios_xctest_test") { |  1211 set_defaults("ios_xctest_test") { | 
|  1217   configs = default_executable_configs |  1212   configs = default_executable_configs | 
|  1218 } |  1213 } | 
| OLD | NEW |