GN target function doesn't apply target defaults |
||
Issue description
This:
target("static_library", "foo") { ... }
Should be the same as:
static_library("foo") { ... }
But currently target() doesn't apply the defaults based on the first parameter. This limits the usefulness of target() to cases where there is a set_defaults (basically just component).
,
Jul 14 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/af92718f5526ce94ea8fcb4118f850fb9a7517b3 commit af92718f5526ce94ea8fcb4118f850fb9a7517b3 Author: brettw <brettw@chromium.org> Date: Thu Jul 14 19:43:53 2016 GN: Use the correct defaults for templates invoked via target(). Previously calling target("foo", "bar") where "foo" is a template applied the defaults for the function named "target" (since this is the function call) rather than "foo". This change properly applies the defaults for "foo" in this case. BUG= 624564 Review-Url: https://codereview.chromium.org/2148093002 Cr-Commit-Position: refs/heads/master@{#405547} [modify] https://crrev.com/af92718f5526ce94ea8fcb4118f850fb9a7517b3/tools/gn/functions.cc [modify] https://crrev.com/af92718f5526ce94ea8fcb4118f850fb9a7517b3/tools/gn/functions_target.cc [modify] https://crrev.com/af92718f5526ce94ea8fcb4118f850fb9a7517b3/tools/gn/functions_target_unittest.cc [modify] https://crrev.com/af92718f5526ce94ea8fcb4118f850fb9a7517b3/tools/gn/template.cc [modify] https://crrev.com/af92718f5526ce94ea8fcb4118f850fb9a7517b3/tools/gn/template.h
,
Jul 14 2016
|
||
►
Sign in to add a comment |
||
Comment 1 by brettw@chromium.org
, Jul 13 2016Turns out calling target("foo", "bar") where "foo" is a template is applying the defaults for the function named "target" (since this is the function call) rather than "foo". This works properly when "foo" is not a template.