Closed lyrahgames closed 4 months ago
It is available in today's staged toolchain. Could you give it a try and let me know if there are any issues? Thanks!
I have tested it and it works. Thank you very much.
Unfortunately, the project also uses CMake-based variable substitution, e.g.
#define SNITCH_VERSION "${PROJECT_VERSION}"
And I wanted to address these by providing the key-value pairs as assignments, like in the following snippet.
using autoconf
# ...
hxx{snitch_config}: in{snitch_config.hpp.config}
{
autoconf.flavor = cmake
PROJECT_VERSION = $version
# ...
}
However, it seems to ignore the substitution. I might have misunderstood the flavor
variable.
Is CMake-based substitution supported in the autoconf
module?
No, CMake ${VAR}
style substitutions are not supported and it won't be easy to add this support (since we rely on the in
module for actual substitution handling).
I suggest that you replace ${VAR}
with @VAR@
. If you don't want to patch upstream code, you can do it during the build with an ad hoc recipe along these lines:
in{snitch_config.hpp.config.in}: file{snitch_config.hpp.config}
{{
sed -e 's/\$\{(.+)\}/@\1@/g' $path($<) >$path($>)
}}
hxx{snitch_config}: in{snitch_config.hpp.config.in}
{{
...
}}
Thank you all very much for the work on this module. I want to package a third-party project that uses
#cmakedefine01
. Unfortunately, the module and the code show that this is not supported, yet. Would you mind adding this feature?I would also offer my help and try to do it myself. However, as I have never worked with build2 modules and this module in particular, it would take me a large amount of time because I would need to read and comprehend the documentation and the source code and, initially, probably do a lot of mistakes.