OleksandrKvl / sbepp

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

Check that `sbeppc_compile_schema` correctly sets target dependencies #47

Closed OleksandrKvl closed 5 months ago

OleksandrKvl commented 6 months ago

Experiencing a strange issue locally, changing sbeppc source code doesn't lead to automatic schema recompilation and following test rebuild. When schema XML is changed, it's recompiled but test is not rebuilt, it gets so only on the next build command. Not sure it behaved like this with previous CMake versions (now I have 3.29.1).

Expected behavior is that changing either sbeppc or schema XML should lead to schema recompilation and test rebuild.

OleksandrKvl commented 5 months ago

As explained here, current approach is not bullet-proof, it doesn't work well with Ninja. There are couple of options:

The last 2 options require adding schema file to CMAKE_CONFIGURE_DEPENDS to force re-configuration if it changes.

OleksandrKvl commented 5 months ago

execute_process approach is not an option because it's not possible to pass $<TARGET_NAME:sbepp::sbeppc> to it. Writing XML parser using CMake is simply not feasible, another option is to use regular expressions but it's not bullet-proof. Injecting anchor file include is the most robust and simple approach here.