I want to conditionally define a variable that I then can use within C/C++ sources to conditionally compile some code, like this:
#ifdef MY_MESON_VARIABLE
// some code
#endif
How do I go about actually setting MY_MESON_VARIABLE from Meson build system code such that it becomes accessible to the C preprocessor? I already know how do flow control in Meson, so I just need to know how to set a preprocessor variable.
-DMU_MESON_VARIABLE(or/DMU_MESON_VARIABLEfor visual) to the command line, your build system might have dedicated api to add those definitions.