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..be4328cfe7aa67d4a5659e95d39c9bf97fb1b798 |
--- /dev/null |
+++ b/build/gn_helper_scripts.gni |
@@ -0,0 +1,65 @@ |
+# 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 = [ |
+ host_toolchain, |
+ current_toolchain, |
+ rebase_path(root_out_dir + "/" + invoker.binary_name, root_build_dir) |
+ ] |
+ if (defined(invoker.args)) { |
+ args += invoker.args |
+ } |
+ |
+ if (defined(invoker.datadeps)) { |
+ datadeps += invoker.datadeps |
+ } |
+ if (defined(invoker.deps)) { |
+ deps = invoker.deps |
+ } |
+ } |
+} |
+ |
+template("run_executable_foreach") { |
+ action_foreach("${target_name}") { |
+ script = "//build/gn_run_binary.py" |
+ sources = invoker.sources |
+ if (defined(invoker.outputs)) { |
+ outputs = invoker.outputs |
+ } |
+ if (defined(invoker.source_prereqs)) { |
+ source_prereqs = invoker.source_prereqs |
+ } |
+ |
+ args = [ |
+ host_toolchain, |
+ current_toolchain, |
+ rebase_path(root_out_dir + "/" + invoker.binary_name, root_build_dir) |
+ ] |
+ if (defined(invoker.args)) { |
+ args += invoker.args |
+ } |
+ |
+ if (defined(invoker.datadeps)) { |
+ datadeps += invoker.datadeps |
+ } |
+ if (defined(invoker.deps)) { |
+ deps = invoker.deps |
+ } |
+ } |
+} |
+ |