From ba8267a4cd03841abdc615308162030e58f35e22 Mon Sep 17 00:00:00 2001 From: Andri Yngvason Date: Wed, 22 Jan 2020 22:03:37 +0000 Subject: [PATCH] meson: Disable asserts in release builds --- meson.build | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 452ad85..e68c99b 100644 --- a/meson.build +++ b/meson.build @@ -8,10 +8,18 @@ project( ], ) -add_project_arguments([ +buildtype = get_option('buildtype') + +c_args = [ '-D_GNU_SOURCE', '-fvisibility=hidden', -], language: 'c') +] + +if buildtype == 'release' or buildtype == 'plain' + c_args += '-DNDEBUG' +endif + +add_project_arguments(c_args, language: 'c') cc = meson.get_compiler('c')