mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-03 20:31:23 +00:00
Make --bfbs-filenames default to location of first schema file. (#6705)
* Make --bfbs-filenames default to location of first schema file. Make RelativeToProjectRoot always work, applying "../" where needed. This is needed for backwards compatibility. The first input file may be deeper in some directory than the other files. Now, there will always be a declaration file. * documentation * clang format Co-authored-by: Casper Neo <cneo@google.com>
This commit is contained in:
@@ -1339,7 +1339,6 @@ void ParseProtoTestWithIncludes() {
|
||||
flatbuffers::IDLOptions opts;
|
||||
opts.include_dependence_headers = true;
|
||||
opts.proto_mode = true;
|
||||
opts.project_root = test_data_path;
|
||||
|
||||
// Parse proto.
|
||||
flatbuffers::Parser parser(opts);
|
||||
@@ -1357,9 +1356,7 @@ void ParseProtoTestWithIncludes() {
|
||||
auto import_fbs = flatbuffers::GenerateFBS(import_parser, "test");
|
||||
|
||||
// Ensure generated file is parsable.
|
||||
flatbuffers::IDLOptions opts2;
|
||||
opts2.project_root = protopath;
|
||||
flatbuffers::Parser parser2(opts2);
|
||||
flatbuffers::Parser parser2;
|
||||
// Since `imported.fbs` isn't in the filesystem AbsolutePath can't figure it
|
||||
// out by itself. We manually construct it so Parser works.
|
||||
std::string imported_fbs = flatbuffers::PosixPath(
|
||||
|
||||
Reference in New Issue
Block a user