I want to pass "-DDEBUG" to the C++ compiler when the build type starts with "debug", something like this:
if meson.build_type().starts_with('debug')
add_global_arguments('-DDEBUG', language : 'cpp')
endif
However there is no meson.build_type()
, so I get this error message from meson:
Meson encountered an error in file meson.build, line 5, column 23:
Unknown method "build_type" in object.
How can I get the build type? Or is there a different way to define DEBUG
in debug builds?