Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(696)

Unified Diff: build/compiled_action.gni

Issue 505403002: Fix compiled action dependencies in GN. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix module.c compilation Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/yasm/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/compiled_action.gni
diff --git a/build/compiled_action.gni b/build/compiled_action.gni
index 937069113f8ac28fdd9022d12ea2c09cb8369a20..2fb4532e5823c9d6a0fb0c2b9cb171465fb114b0 100644
--- a/build/compiled_action.gni
+++ b/build/compiled_action.gni
@@ -23,8 +23,12 @@
# args (required)
# [list of strings] Same meaning as action/action_foreach.
#
+# inputs (optional)
+# Files the binary takes as input. The step will be re-run whenever any
+# of these change. If inputs is empty, the step will run only when the
+# binary itself changes.
+#
# visibility
-# inputs
# deps
# args (all optional)
# Same meaning as action/action_foreach.
@@ -67,6 +71,9 @@ template("compiled_action") {
assert(defined(invoker.outputs), "outputs must be defined for $target_name")
assert(defined(invoker.args), "args must be defined for $target_name")
+ assert(!defined(invoker.sources),
+ "compiled_action doesn't take a sources arg. Use inputs instead.")
+
action(target_name) {
if (defined(invoker.visibility)) {
visibility = invoker.visibility
@@ -76,6 +83,8 @@ template("compiled_action") {
if (defined(invoker.inputs)) {
inputs = invoker.inputs
+ } else {
+ inputs = []
}
outputs = invoker.outputs
@@ -90,6 +99,9 @@ template("compiled_action") {
host_executable = get_label_info(host_tool, "root_out_dir") + "/" +
get_label_info(host_tool, "name")
+ # Add the executable itself as an input.
+ inputs += [ host_executable ]
+
deps = [ host_tool ]
if (defined(invoker.deps)) {
deps += invoker.deps
@@ -120,6 +132,8 @@ template("compiled_action_foreach") {
if (defined(invoker.inputs)) {
inputs = invoker.inputs
+ } else {
+ inputs = []
}
outputs = invoker.outputs
@@ -134,6 +148,9 @@ template("compiled_action_foreach") {
host_executable = get_label_info(host_tool, "root_out_dir") + "/" +
get_label_info(host_tool, "name")
+ # Add the executable itself as an input.
+ inputs += [ host_executable ]
+
deps = [ host_tool ]
if (defined(invoker.deps)) {
deps += invoker.deps
« no previous file with comments | « no previous file | third_party/yasm/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698