Added --keep-prefix to not strip schema include path in C++ includes.

Change-Id: I3c6356fc6664072796f273096df64829108b4a34
Tested: on Linux.
This commit is contained in:
Wouter van Oortmerssen
2017-05-10 13:21:20 -07:00
parent 04d734d6d2
commit 93c0960c3a
4 changed files with 10 additions and 2 deletions

View File

@@ -72,8 +72,9 @@ class CppGenerator : public BaseGenerator {
}
for (auto it = parser_.included_files_.begin();
it != parser_.included_files_.end(); ++it) {
const auto basename =
flatbuffers::StripPath(flatbuffers::StripExtension(it->first));
auto basename = flatbuffers::StripExtension(it->first);
if (!parser_.opts.keep_include_path)
basename = flatbuffers::StripPath(basename);
if (basename != file_name_) {
code_ += "#include \"" + parser_.opts.include_prefix + basename +
"_generated.h\"";