-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow custom file suffix #5753
Comments
Yes, an option for generated file extension would be good. I guess C++ is the only language we currently support where more than 1 extension is ever used? |
Yeah, I think C++ is the only language with that property. For most flexibility, we could have two options:
What do you think? |
That sounds fine to me. Though, if we haven't ever seen a reason why an other language programmer would want to change the extension, it is not worth supporting? Either way, feel free to create a PR supporting some or all of this. |
+1 to |
@dbaileychess thanks for taking over and filing a PR. Great to see this one completed so quickly! |
When generating C++ headers via
flatc
, all files have the suffix_generated.h
. However, in many modern C++ projects we have a*.hpp
extension. It's not possible to just rename the files, because the generated files include themselves and have the name hardcoded inside. It would be great to have the ability to specify the suffix explicitly.In #5054 I suggested an option
--filename-suffix
that allows for customizing everything that comes after the name of the schema. For example,flatc --file-suffix .hpp
would create a filename for the schemafoo
that has the namefoo.hpp
instead offoo_generated.h
.The text was updated successfully, but these errors were encountered: