| 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/mac/base_rules.gni") | 5 import("//build/config/mac/base_rules.gni") |
| 6 | 6 |
| 7 # Generates Info.plist files for Mac apps and frameworks. | 7 # Generates Info.plist files for Mac apps and frameworks. |
| 8 # | 8 # |
| 9 # Arguments | 9 # Arguments |
| 10 # | 10 # |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 # specified in a source Info.plist template. | 149 # specified in a source Info.plist template. |
| 150 # | 150 # |
| 151 # See "gn help shared_library" for more information on arguments supported | 151 # See "gn help shared_library" for more information on arguments supported |
| 152 # by shared library target. | 152 # by shared library target. |
| 153 template("mac_framework_bundle") { | 153 template("mac_framework_bundle") { |
| 154 assert(defined(invoker.deps), | 154 assert(defined(invoker.deps), |
| 155 "Dependencies must be specified for $target_name") | 155 "Dependencies must be specified for $target_name") |
| 156 | 156 |
| 157 _info_plist_target = target_name + "_info_plist" | 157 _info_plist_target = target_name + "_info_plist" |
| 158 | 158 |
| 159 if (defined(invoker.linker_inputs)) { assert(invoker.linker_inputs != []) } |
| 160 |
| 159 mac_info_plist(_info_plist_target) { | 161 mac_info_plist(_info_plist_target) { |
| 160 executable_name = target_name | 162 executable_name = target_name |
| 161 if (defined(invoker.output_name)) { | 163 if (defined(invoker.output_name)) { |
| 162 executable_name = invoker.output_name | 164 executable_name = invoker.output_name |
| 163 } | 165 } |
| 164 forward_variables_from(invoker, | 166 forward_variables_from(invoker, |
| 165 [ | 167 [ |
| 166 "extra_substitutions", | 168 "extra_substitutions", |
| 167 "info_plist", | 169 "info_plist", |
| 168 "info_plist_target", | 170 "info_plist_target", |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 # (optional) string, name of the generated app without the | 212 # (optional) string, name of the generated app without the |
| 211 # .app suffix. If omitted, defaults to target_name. | 213 # .app suffix. If omitted, defaults to target_name. |
| 212 # | 214 # |
| 213 # extra_configs: | 215 # extra_configs: |
| 214 # (optional) list of label, additional configs to apply to the | 216 # (optional) list of label, additional configs to apply to the |
| 215 # executable target. | 217 # executable target. |
| 216 # | 218 # |
| 217 # remove_configs: | 219 # remove_configs: |
| 218 # (optional) list of label, default configs to remove from the target. | 220 # (optional) list of label, default configs to remove from the target. |
| 219 # | 221 # |
| 222 # linker_inputs: |
| 223 # (optional) list of string, additional inputs to list to the link step |
| 224 # that are not source files. Examples would be strip, save, or order |
| 225 # files. |
| 226 # |
| 220 # extra_substitutions: | 227 # extra_substitutions: |
| 221 # (optional) string array, 'key=value' pairs for extra fields which are | 228 # (optional) string array, 'key=value' pairs for extra fields which are |
| 222 # specified in a source Info.plist template. | 229 # specified in a source Info.plist template. |
| 223 template("mac_app_bundle") { | 230 template("mac_app_bundle") { |
| 224 _target_name = target_name | 231 _target_name = target_name |
| 225 _output_name = target_name | 232 _output_name = target_name |
| 226 if (defined(invoker.output_name)) { | 233 if (defined(invoker.output_name)) { |
| 227 _output_name = invoker.output_name | 234 _output_name = invoker.output_name |
| 228 } | 235 } |
| 229 | 236 |
| 230 _executable_target = target_name + "_executable" | 237 _executable_target = target_name + "_executable" |
| 231 _executable_bundle_data = _executable_target + "_bundle_data" | 238 _executable_bundle_data = _executable_target + "_bundle_data" |
| 232 | 239 |
| 233 _info_plist_target = target_name + "_info_plist" | 240 _info_plist_target = target_name + "_info_plist" |
| 234 | 241 |
| 242 # Hack for https://crbug.com/395883. |
| 243 if (defined(invoker.linker_inputs)) { assert(invoker.linker_inputs != []) } |
| 244 |
| 235 mac_info_plist(_info_plist_target) { | 245 mac_info_plist(_info_plist_target) { |
| 236 executable_name = _output_name | 246 executable_name = _output_name |
| 237 forward_variables_from(invoker, | 247 forward_variables_from(invoker, |
| 238 [ | 248 [ |
| 239 "extra_substitutions", | 249 "extra_substitutions", |
| 240 "info_plist", | 250 "info_plist", |
| 241 "info_plist_target", | 251 "info_plist_target", |
| 242 "testonly", | 252 "testonly", |
| 243 ]) | 253 ]) |
| 244 } | 254 } |
| (...skipping 24 matching lines...) Expand all Loading... |
| 269 "info_plist", | 279 "info_plist", |
| 270 "output_name", | 280 "output_name", |
| 271 "visibility", | 281 "visibility", |
| 272 ]) | 282 ]) |
| 273 if (defined(extra_configs)) { | 283 if (defined(extra_configs)) { |
| 274 configs += extra_configs | 284 configs += extra_configs |
| 275 } | 285 } |
| 276 if (defined(remove_configs)) { | 286 if (defined(remove_configs)) { |
| 277 configs -= remove_configs | 287 configs -= remove_configs |
| 278 } | 288 } |
| 289 if (defined(invoker.linker_inputs)) { |
| 290 inputs = invoker.linker_inputs |
| 291 } |
| 279 output_name = _output_name | 292 output_name = _output_name |
| 280 output_dir = "$target_out_dir/$_executable_target" | 293 output_dir = "$target_out_dir/$_executable_target" |
| 281 } | 294 } |
| 282 | 295 |
| 283 bundle_data(_executable_bundle_data) { | 296 bundle_data(_executable_bundle_data) { |
| 284 visibility = [ ":$_target_name" ] | 297 visibility = [ ":$_target_name" ] |
| 285 forward_variables_from(invoker, [ "testonly" ]) | 298 forward_variables_from(invoker, [ "testonly" ]) |
| 286 sources = [ | 299 sources = [ |
| 287 "$target_out_dir/$_executable_target/$_output_name", | 300 "$target_out_dir/$_executable_target/$_output_name", |
| 288 ] | 301 ] |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 ]) | 413 ]) |
| 401 if (!defined(deps)) { | 414 if (!defined(deps)) { |
| 402 deps = [] | 415 deps = [] |
| 403 } | 416 } |
| 404 deps += [ ":$_loadable_module_bundle_data" ] | 417 deps += [ ":$_loadable_module_bundle_data" ] |
| 405 | 418 |
| 406 bundle_root_dir = "$root_out_dir/$_output_name.plugin/Contents" | 419 bundle_root_dir = "$root_out_dir/$_output_name.plugin/Contents" |
| 407 bundle_executable_dir = "$bundle_root_dir/MacOS" | 420 bundle_executable_dir = "$bundle_root_dir/MacOS" |
| 408 } | 421 } |
| 409 } | 422 } |
| OLD | NEW |