summaryrefslogtreecommitdiffstats
path: root/third_party
diff options
context:
space:
mode:
authorBrett Wilson <brettw@chromium.org>2014-08-28 13:24:32 -0700
committerBrett Wilson <brettw@chromium.org>2014-08-28 20:25:39 +0000
commit4b04efb439a19c6dfef213a2fe51751b223f9cbd (patch)
tree6ece0a792c55d80c337bc14768e0cf3b4855f925 /third_party
parentc0be27918a3bf1c6d8bbc230ee1e41040b4f3644 (diff)
downloadchromium_src-4b04efb439a19c6dfef213a2fe51751b223f9cbd.zip
chromium_src-4b04efb439a19c6dfef213a2fe51751b223f9cbd.tar.gz
chromium_src-4b04efb439a19c6dfef213a2fe51751b223f9cbd.tar.bz2
Fix compiled action dependencies in GN.
The yasm uses of compiled action used sources instead of inputs. Sources applies to the _foreach version but not the plain "compiled_action". These did not trigger an unused variable warning because the declarations themselves dereferenced the sources variable for computing args to the script. This adds some extra documentation and assertion to the compiled action template. It also adds the binary itself as an input. This should be strictly unnecessary since there should be an implicit dependency on the target, but I like this since it makes things more explicit. R=ajwong@chromium.org Review URL: https://codereview.chromium.org/505403002 Cr-Commit-Position: refs/heads/master@{#292447}
Diffstat (limited to 'third_party')
-rw-r--r--third_party/yasm/BUILD.gn20
1 files changed, 11 insertions, 9 deletions
diff --git a/third_party/yasm/BUILD.gn b/third_party/yasm/BUILD.gn
index 812be9a..9429bc0 100644
--- a/third_party/yasm/BUILD.gn
+++ b/third_party/yasm/BUILD.gn
@@ -292,12 +292,12 @@ if (current_toolchain == host_toolchain) {
compiled_action(target_name) {
tool = ":genmacro"
# Output #included by source/patched-yasm/frontends/yasm/yasm.c.
- sources = invoker.sources
+ inputs = invoker.sources
outputs = invoker.outputs
args = [
rebase_path(outputs[0], root_build_dir),
invoker.macro_varname,
- rebase_path(sources[0], root_build_dir),
+ rebase_path(inputs[0], root_build_dir),
]
if (defined(invoker.deps)) {
deps = invoker.deps
@@ -354,35 +354,37 @@ if (current_toolchain == host_toolchain) {
# This call doesn't fit into the re2c template above.
compiled_action("compile_re2c_lc3b") {
tool = ":re2c"
- sources = [ "source/patched-yasm/modules/arch/lc3b/lc3bid.re" ]
+ inputs = [ "source/patched-yasm/modules/arch/lc3b/lc3bid.re" ]
outputs = [ "$target_gen_dir/lc3bid.c" ]
args = [
"-s",
"-o",
rebase_path(outputs[0], root_build_dir),
- rebase_path(sources[0], root_build_dir),
+ rebase_path(inputs[0], root_build_dir),
]
}
compiled_action("generate_license") {
tool = ":genstring"
# Output #included by source/patched-yasm/frontends/yasm/yasm.c.
- sources = [ "source/patched-yasm/COPYING" ]
+ inputs = [ "source/patched-yasm/COPYING" ]
outputs = [ "$yasm_gen_include_dir/license.c" ]
args = [
"license_msg",
rebase_path(outputs[0], root_build_dir),
- rebase_path(sources[0], root_build_dir),
+ rebase_path(inputs[0], root_build_dir),
]
}
compiled_action("generate_module") {
tool = ":genmodule"
- inputs = [ config_makefile ]
- sources = [ "source/patched-yasm/libyasm/module.in" ]
+ inputs = [
+ "source/patched-yasm/libyasm/module.in",
+ config_makefile,
+ ]
outputs = [ "$target_gen_dir/module.c" ]
args = [
- rebase_path(sources[0], root_build_dir),
+ rebase_path(inputs[0], root_build_dir),
rebase_path(config_makefile, root_build_dir),
rebase_path(outputs[0], root_build_dir),
]