Chromium Code Reviews| Index: build/gn_helper_scripts.gni |
| diff --git a/build/gn_helper_scripts.gni b/build/gn_helper_scripts.gni |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..3c50528abdd94d83748c0141b7884f3deef4e0b0 |
| --- /dev/null |
| +++ b/build/gn_helper_scripts.gni |
| @@ -0,0 +1,54 @@ |
| +# Copyright 2014 The Chromium Authors. All rights reserved. |
| +# Use of this source code is governed by a BSD-style license that can be |
| +# found in the LICENSE file. |
| + |
| +template("run_executable") { |
| + action("${target_name}") { |
| + script = "//build/gn_run_binary.py" |
| + |
| + if (defined(invoker.sources)) { sources = invoker.sources } |
| + if (defined(invoker.outputs)) { outputs = invoker.outputs } |
| + if (defined(invoker.source_prereqs)) { |
| + source_prereqs = invoker.source_prereqs |
| + } |
| + |
| + args = [ |
| + rebase_path(root_out_dir + "/" + invoker.binary_name, root_build_dir) |
| + ] |
| + if (defined(invoker.args)) { |
| + args += invoker.args |
| + } |
| + |
| + datadeps = [ "//build:gn_helper_scripts" ] |
| + if (defined(invoker.datadeps)) { |
| + datadeps += invoker.datadeps |
| + } |
| + if (defined(invoker.deps)) { deps = invoker.deps } |
|
brettw
2014/05/05 16:46:50
Can you expand this onto multiple lines? Same abov
awong
2014/05/05 19:28:34
Done.
|
| + } |
| +} |
| + |
| +template("run_executable_foreach") { |
| + action_foreach("${target_name}") { |
| + script = "//build/gn_run_binary.py" |
| + |
| + if (defined(invoker.sources)) { sources = invoker.sources } |
| + if (defined(invoker.outputs)) { outputs = invoker.outputs } |
| + if (defined(invoker.source_prereqs)) { |
| + source_prereqs = invoker.source_prereqs |
| + } |
| + |
| + args = [ |
| + rebase_path(root_out_dir + "/" + invoker.binary_name, root_build_dir) |
| + ] |
| + if (defined(invoker.args)) { |
| + args += invoker.args |
| + } |
| + |
| + datadeps = [ "//build:gn_helper_scripts" ] |
| + if (defined(invoker.datadeps)) { |
| + datadeps += invoker.datadeps |
| + } |
| + if (defined(invoker.deps)) { deps = invoker.deps } |
| + } |
| +} |
| + |