[Mesa-dev] [PATCH] meson: warn if building a non-debug build with asserts
Eric Engestrom
eric.engestrom at imgtec.com
Wed Dec 13 21:43:24 UTC 2017
On Wednesday, 2017-12-13 10:33:05 -0800, Dylan Baker wrote:
> cc: Jason Ekstrand <jason.ekstrand at gmail.com>
> Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
> ---
> meson.build | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/meson.build b/meson.build
> index 6e5ae4d24e9..b00c1ffc3dc 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -29,6 +29,15 @@ project(
> default_options : ['buildtype=debugoptimized', 'c_std=c99', 'cpp_std=c++11']
> )
>
> +if not get_option('b_ndebug') and not get_option('buildtype').startswith('debug')
> + _warn = 'Building a release or plain type build with asserts enabled. You probably also want to set -Dn_debug=true'
> + if meson.version().version_compare('< 0.44')
> + message(_warn)
> + else
> + warning(_warn)
A bit surprised this compiles on old meson versions (I guess you weren't
lying when you said the parser was lazy ^^), but adding a warning for
this is a good idea given the spread of the confusion that was revealed
a little while ago.
Acked-by: Eric Engestrom <eric.engestrom at imgtec.com>
> + endif
> +endif
> +
> # Arguments for the preprocessor, put these in a separate array from the C and
> # C++ (cpp in meson terminology) arguments since they need to be added to the
> # default arguments for both C and C++.
> --
> 2.15.1
>
More information about the mesa-dev
mailing list