Closed OleksandrKvl closed 5 months ago
As explained here, current approach is not bullet-proof, it doesn't work well with Ninja. There are couple of options:
sbeppc
CLI parameter to inject #include <anchor_file>
into each generated file to establish depsfile(READ)
to get schema name from itsbeppc
CLI parameter to get schema name and use execute_process
to run itThe last 2 options require adding schema file to CMAKE_CONFIGURE_DEPENDS
to force re-configuration if it changes.
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.
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.