Index: tools/json_schema_compiler/json_features.gni |
diff --git a/tools/json_schema_compiler/json_features.gni b/tools/json_schema_compiler/json_features.gni |
index cdf6c33a30a325550891f72d9e8fb7837cf58dce..ab940f72e52ef7cbd7f93ed9983eae5302116996 100644 |
--- a/tools/json_schema_compiler/json_features.gni |
+++ b/tools/json_schema_compiler/json_features.gni |
@@ -8,6 +8,7 @@ |
# feature_class: The name of the feature class to generate, e.g. APIFeature. |
# provider_class: The name of the provider class to generate, e.g. |
# APIFeatureProvider. |
+# deps/public_deps/visibility: normal meaning |
template("json_features") { |
assert(defined(invoker.sources), |
"\"sources\" must be defined for the $target_name template.") |
@@ -21,12 +22,14 @@ template("json_features") { |
compiler_root = "//tools/json_schema_compiler" |
base_filename = target_name |
action_name = "${target_name}_json_features" |
+ source_set_name = target_name |
generated_files = [ |
"$target_gen_dir/$base_filename.cc", |
"$target_gen_dir/$base_filename.h", |
] |
action(action_name) { |
+ visibility = [ ":$source_set_name" ] |
sources = invoker.sources |
script = "$compiler_root/feature_compiler.py" |
inputs = [ |
@@ -42,12 +45,34 @@ template("json_features") { |
rebase_path(target_gen_dir, root_build_dir), |
"$base_filename", |
] + rebased |
+ |
+ # Add the deps in for the action as well, in case the deps generate the |
+ # inputs used by the action. |
+ forward_variables_from(invoker, |
+ [ |
+ "deps", |
+ "public_deps", |
+ ]) |
+ |
+ # Append a dependency on the extensions system. Headers in this target |
+ # are included by the feature compiler automatically. |
+ if (!defined(deps)) { |
+ deps = [] |
+ } |
+ deps += [ "//extensions/common" ] |
} |
source_set(target_name) { |
sources = generated_files |
- public_deps = [ |
- ":$action_name", |
- ] |
+ forward_variables_from(invoker, |
+ [ |
+ "deps", |
+ "public_deps", |
+ "visibility", |
+ ]) |
+ if (!defined(public_deps)) { |
+ public_deps = [] |
+ } |
+ public_deps += [ ":$action_name" ] |
} |
} |