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

Unified Diff: tools/json_schema_compiler/json_features.gni

Issue 2479593006: Move enable extensions define to a build flag. (Closed)
Patch Set: Merge Created 4 years, 1 month 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 | « tools/grit/grit_rule.gni ('k') | tools/json_schema_compiler/test/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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" ]
}
}
« no previous file with comments | « tools/grit/grit_rule.gni ('k') | tools/json_schema_compiler/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698