Re: [Mesa-dev] [PATCH] meson: warn if building a non-debug build with asserts

2017-12-13 Thread Dylan Baker
Quoting Eric Engestrom (2017-12-13 13:43:24)
> On Wednesday, 2017-12-13 10:33:05 -0800, Dylan Baker wrote:
> > cc: Jason Ekstrand 
> > Signed-off-by: Dylan Baker 
> > ---
> >  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 

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


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] meson: warn if building a non-debug build with asserts

2017-12-13 Thread Eric Engestrom
On Wednesday, 2017-12-13 10:33:05 -0800, Dylan Baker wrote:
> cc: Jason Ekstrand 
> Signed-off-by: Dylan Baker 
> ---
>  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 

> +  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
> 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] meson: warn if building a non-debug build with asserts

2017-12-13 Thread Dylan Baker
cc: Jason Ekstrand 
Signed-off-by: Dylan Baker 
---
 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)
+  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

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev