-
Notifications
You must be signed in to change notification settings - Fork 213
Description
Hello,
I've noticed that flatcc always strips away the prefix of an included file when formatting the include path in the header file.
For instance, if in my flatbuffers schema I have the following:
include "path/to/included_schema.fbs";
then in the generated header file the included path will always strip away the directories:
#ifndef INCLUDED_SCHEMA_READER_H
#include "included_schema_reader.h"
#endif
I know that flatbuffers has an option called --keep-prefix that allows you to keep the prefix of the path so that the generated header file looks like this:
#ifndef INCLUDED_SCHEMA_READER_H
#include "path/to/included_schema_reader.h"
#endif
This would be very useful for me as I have a quite big project where the schemas are spread across multiple directories and, without the prefix, I would need to add quite a lot of include paths in the cmake files.
Would it be possible to add a --keep-prefix option for flatcc as well? I could also help with the implementation. I've taken a look at the place where the include gets generated and that part wouldn't be too hard to modify to keep the full path instead of the stripped basename. However, I'm not sure exactly how to add a new option and how difficult it would be to integrate that.
Thank you!