| 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/toolchain/toolchain.gni") | 5 import("//build/toolchain/toolchain.gni") |
| 6 import("//build/config/mac/mac_sdk.gni") | 6 import("//build/config/mac/mac_sdk.gni") |
| 7 import("//build/util/version.gni") | 7 import("//build/util/version.gni") |
| 8 | 8 |
| 9 # Used to generate an Info.plist file for iOS and Mac apps and frameworks. | 9 # Used to generate an Info.plist file for iOS and Mac apps and frameworks. |
| 10 template("info_plist") { | 10 template("info_plist") { |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 # | 421 # |
| 422 # This takes no extra arguments that differ from a loadable_module. | 422 # This takes no extra arguments that differ from a loadable_module. |
| 423 template("mac_plugin_bundle") { | 423 template("mac_plugin_bundle") { |
| 424 assert(defined(invoker.deps), | 424 assert(defined(invoker.deps), |
| 425 "Dependencies must be specified for $target_name") | 425 "Dependencies must be specified for $target_name") |
| 426 | 426 |
| 427 _target_name = target_name | 427 _target_name = target_name |
| 428 _loadable_module_target = _target_name + "_loadable_module" | 428 _loadable_module_target = _target_name + "_loadable_module" |
| 429 _loadable_module_bundle_data = _loadable_module_target + "_bundle_data" | 429 _loadable_module_bundle_data = _loadable_module_target + "_bundle_data" |
| 430 | 430 |
| 431 _output_name = _target_name |
| 432 if (defined(invoker.output_name)) { |
| 433 _output_name = invoker.output_name |
| 434 } |
| 435 |
| 431 loadable_module(_loadable_module_target) { | 436 loadable_module(_loadable_module_target) { |
| 432 visibility = [ ":$_loadable_module_bundle_data" ] | 437 visibility = [ ":$_loadable_module_bundle_data" ] |
| 433 forward_variables_from(invoker, | 438 forward_variables_from(invoker, |
| 434 "*", | 439 "*", |
| 435 [ | 440 [ |
| 436 "assert_no_deps", | 441 "assert_no_deps", |
| 437 "data_deps", | 442 "data_deps", |
| 438 "output_name", | 443 "output_name", |
| 439 "visibility", | 444 "visibility", |
| 440 ]) | 445 ]) |
| 446 output_dir = "$target_out_dir" |
| 447 output_name = _output_name |
| 441 } | 448 } |
| 442 | 449 |
| 443 bundle_data(_loadable_module_bundle_data) { | 450 bundle_data(_loadable_module_bundle_data) { |
| 451 forward_variables_from(invoker, [ "testonly" ]) |
| 444 visibility = [ ":$_target_name" ] | 452 visibility = [ ":$_target_name" ] |
| 445 sources = [ | 453 sources = [ |
| 446 "$root_out_dir/${_loadable_module_target}.so", | 454 "$target_out_dir/${_output_name}.so", |
| 447 ] | 455 ] |
| 448 outputs = [ | 456 outputs = [ |
| 449 "{{bundle_executable_dir}}/$_target_name", | 457 "{{bundle_executable_dir}}/$_output_name", |
| 450 ] | 458 ] |
| 451 public_deps = [ | 459 public_deps = [ |
| 452 ":$_loadable_module_target", | 460 ":$_loadable_module_target", |
| 453 ] | 461 ] |
| 454 } | 462 } |
| 455 | 463 |
| 456 create_bundle(_target_name) { | 464 create_bundle(_target_name) { |
| 457 forward_variables_from(invoker, | 465 forward_variables_from(invoker, |
| 458 [ | 466 [ |
| 459 "data_deps", | 467 "data_deps", |
| 460 "deps", | 468 "deps", |
| 461 "public_deps", | 469 "public_deps", |
| 462 "testonly", | 470 "testonly", |
| 463 "visibility", | 471 "visibility", |
| 464 ]) | 472 ]) |
| 465 if (!defined(deps)) { | 473 if (!defined(deps)) { |
| 466 deps = [] | 474 deps = [] |
| 467 } | 475 } |
| 468 deps += [ ":$_loadable_module_bundle_data" ] | 476 deps += [ ":$_loadable_module_bundle_data" ] |
| 469 | 477 |
| 470 bundle_root_dir = "$root_out_dir/$_target_name.plugin/Contents" | 478 bundle_root_dir = "$root_out_dir/$_output_name.plugin/Contents" |
| 471 bundle_executable_dir = "$bundle_root_dir/MacOS" | 479 bundle_executable_dir = "$bundle_root_dir/MacOS" |
| 472 } | 480 } |
| 473 } | 481 } |
| OLD | NEW |