Keep include prefix when converting from proto.
This change preserves the include prefix when generating flatbuffers from proto (with FBS_GEN_INCLUDES) defined.
This commit is contained in:
parent
ce3a1c43a2
commit
4d1a9f8d9e
|
@ -75,8 +75,13 @@ std::string GenerateFBS(const Parser &parser, const std::string &file_name) {
|
||||||
it != parser.included_files_.end(); ++it) {
|
it != parser.included_files_.end(); ++it) {
|
||||||
if (it->second.empty())
|
if (it->second.empty())
|
||||||
continue;
|
continue;
|
||||||
auto basename = flatbuffers::StripPath(
|
std::string basename;
|
||||||
|
if(parser.opts.keep_include_path) {
|
||||||
|
basename = flatbuffers::StripPath(
|
||||||
flatbuffers::StripExtension(it->second));
|
flatbuffers::StripExtension(it->second));
|
||||||
|
} else {
|
||||||
|
basename = flatbuffers::StripExtension(it->second);
|
||||||
|
}
|
||||||
schema += "include \"" + basename + ".fbs\";\n";
|
schema += "include \"" + basename + ".fbs\";\n";
|
||||||
num_includes++;
|
num_includes++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue