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 |