You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The #ifndef ... #define header guard started in codegenTemplates/schemaClass.h should have a corresponding #endif at the end of the same file. Currently, that #endif is added by usdGenSchema.py.
The use case is we prefer using #pragma once as the header guarding mechanism throughout our codebase. It would be useful to be able to make this customisation purely through codegenTemplates.
System Information (OS, Hardware)
ubuntu-18.04
Package Versions
usd-19.11
The text was updated successfully, but these errors were encountered:
Hi @moddyz !
Moving the "terminator" logic entirely out of usdGenSchema and into schemaClass.h templates would require the addition of a new line/token to robustly bracket the custom section... and I think you might also lose the ability to add free functions. But most importantly, the implication is that it would cause a diff to every single generated schema header, which is a pretty high overhead to accommodate this need.
However, we would support a PR that adds a command-line option to usdGenSchema , --headerTerminatorString so that you are not stuck with the hardcoded string that's in there, now, when generating your local schemas. You may want to add a companion argument that customizes the message that accompanies the --(BEGIN CUSTOM CODE)-- so that your users aren't still admonished to "Close the include guard with #endif"
Description of Issue
The
#ifndef ... #define
header guard started in codegenTemplates/schemaClass.h should have a corresponding#endif
at the end of the same file. Currently, that#endif
is added by usdGenSchema.py.The use case is we prefer using
#pragma once
as the header guarding mechanism throughout our codebase. It would be useful to be able to make this customisation purely throughcodegenTemplates
.System Information (OS, Hardware)
ubuntu-18.04
Package Versions
usd-19.11
The text was updated successfully, but these errors were encountered: