[Mesa-dev] [PATCH] meson: warn if building a non-debug build with asserts
Dylan Baker
dylan at pnwbakers.com
Wed Dec 13 22:16:52 UTC 2017
Quoting Eric Engestrom (2017-12-13 13:43:24)
> 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>
Thanks! You basically need the parser to not evaluate paths it's not taking in
an interpreted language since you don't have a preprocessor to remove code that
an older interpreter doesn't understand. Python, for example, behaves the same
way.
Dylan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: signature
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20171213/81f8cc83/attachment.sig>
More information about the mesa-dev
mailing list