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

Dylan Baker dylan at pnwbakers.com
Wed Dec 13 18:33:05 UTC 2017


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)
+  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