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

Unified Diff: third_party/flatbuffers/flatbuffer.gni

Issue 2928573002: [flatbuffers] Enable including by absolute path. (Closed)
Patch Set: Created 3 years, 6 months 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 | « components/subresource_filter/core/common/flat/indexed_ruleset.fbs ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/flatbuffers/flatbuffer.gni
diff --git a/third_party/flatbuffers/flatbuffer.gni b/third_party/flatbuffers/flatbuffer.gni
index f45886d37fa20c78ac23ab10819a711cc602f8ed..cc28b1bd885d4352aeccd52257abd4e4005311bc 100644
--- a/third_party/flatbuffers/flatbuffer.gni
+++ b/third_party/flatbuffers/flatbuffer.gni
@@ -16,14 +16,14 @@
#
# flatc_include_dirs (optional)
# Specifies the directories which FlatBuffers compiler uses to find
-# included .fbs files in.
+# included .fbs files in. Almost always should be empty.
#
-# The directories will be tried in the order given, and if all fail (or,
-# as by default, none are specified) it will try to load relative to the
-# directory of the schema file being parsed.
+# The list always has an implicit first item corresponding to the root of
+# the source tree. This enables including .fbs files by absolute path.
#
-# TODO(pkalinnikov): Add repository root to this list, to allow including
-# by absolute path.
+# The compiler will try the directories in the order given, and if all
+# fail it will try to load relative to the directory of the schema file
+# being parsed.
#
# deps (optional)
# Additional dependencies.
@@ -79,22 +79,25 @@ template("flatbuffer") {
"$out_dir/{{source_name_part}}_generated.h",
]
- args = [ "-c" ]
+ args = [
+ "-c",
+ "--keep-prefix",
+ "-o",
+ "$out_dir",
+ "-I",
+ rebase_path("//", root_build_dir),
+ ]
if (defined(invoker.flatc_include_dirs)) {
foreach(include_dir, invoker.flatc_include_dirs) {
args += [
"-I",
- rebase_path(include_dir, "$root_build_dir"),
+ rebase_path(include_dir, root_build_dir),
]
}
}
- args += [
- "-o",
- "$out_dir",
- "{{source}}",
- ]
+ args += [ "{{source}}" ]
# The deps may have steps that have to run before running flatc.
if (defined(invoker.deps)) {
« no previous file with comments | « components/subresource_filter/core/common/flat/indexed_ruleset.fbs ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698