diff options
-rw-r--r-- | meson.build | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/meson.build b/meson.build index 3d466d52..8196ab63 100644 --- a/meson.build +++ b/meson.build @@ -3,12 +3,22 @@ project('igt-gpu-tools', 'c', default_options: [ 'warning_level=2', 'c_std=gnu11', + 'b_ndebug=false', ], license : 'MIT', meson_version : '>=0.46.0') +if get_option('b_ndebug') != 'false' + error('Building without -Db_ndebug=false is not supported') +endif + cc = meson.get_compiler('c') +# Also make sure that the user doesn't have -DNDEBUG defined in their config +if not cc.compiles(files('lib/check-ndebug.h'), args: get_option('c_args')) + error('Building with NDEBUG defined is not supported') +endif + cc_args = [ '-Wbad-function-cast', '-Wdeclaration-after-statement', |