OleksandrKvl / sbepp

C++ implementation of the FIX Simple Binary Encoding
https://oleksandrkvl.github.io/sbepp/
MIT License
39 stars 4 forks source link

Enforce proper dependencies in `sbeppc_make_schema_target` #50

Closed OleksandrKvl closed 3 months ago

OleksandrKvl commented 3 months ago

It's worth mentioning that the file listed in OUTPUT of a custom command should be included by every other generated file. Otherwise, the situation is possible that consumer target does not include it directly or indirectly and recompilation won't be triggered when schema changes. When SCHEMA_NAME is known, such file is OUTPUT_DIR/SCHEMA_NAME/schema/schema.hpp because it's included by all other generated headers. Otherwise, schema root directory is not known (it depends on schema name), so we don't know path to schema/schema.hpp so a fake anchor file is created (outside schema root directory) and injected into schema.hpp using new --inject-include CLI option.