Hey there! I brought this up yesterday on Reddit, and I wanted to follow up here.
Perhaps this ticket is a good place to discuss whether or not it's worth adding a canonical "define" abstraction in Meson. Here are the reasons that I think such a thing should exist:
- Much like include dirs, defines are usually a property of the source code and the host/target machine, and are often needed independently of the mechanism used to pass them
- Different compilers may have different argument syntaxes for specifying defines. Even MSVC uses "/D" and GCC uses "-D". (And yes, I know that technically MSVC "tolerates" the -D syntax, but that's not its native syntax, and as a thought exercise one could imagine some compiler that doesn't)
- This is already done for other things like include dirs and libraries, where Meson will use the correct compiler argument syntax for whatever compiler is being used
- Other build systems already do it. CMake has this command and Visual Studio has a separate section altogether for preprocessor defines. In general, if there are higher-level semantics for something then isn't it a Good Thing(TM) to capture them rather than having them degrade to compiler flags?
Also - I'm willing to put my time where my mouth is here. With a perhaps a little help I'd be willing to be the one to add whatever feature to Meson - I'd just want to know what you folks think before I go trying to implement something.
Hey there! I brought this up yesterday on Reddit, and I wanted to follow up here.
Perhaps this ticket is a good place to discuss whether or not it's worth adding a canonical "define" abstraction in Meson. Here are the reasons that I think such a thing should exist:
Also - I'm willing to put my time where my mouth is here. With a perhaps a little help I'd be willing to be the one to add whatever feature to Meson - I'd just want to know what you folks think before I go trying to implement something.