From 08587baf4d5e5a1286e024719717c7b706010d0e Mon Sep 17 00:00:00 2001 From: Andri Yngvason Date: Wed, 22 Jan 2020 22:09:47 +0000 Subject: [PATCH] meson: Disable asserts in release builds --- meson.build | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/meson.build b/meson.build index c5e5f98..eb0d4d9 100644 --- a/meson.build +++ b/meson.build @@ -8,26 +8,26 @@ 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 cpu = host_machine.cpu_family() if cpu == 'x86_64' - arch_args = [ - '-mavx', - ] + c_args += '-mavx' elif cpu == 'arm' - arch_args = [ - '-mfpu=neon', - ] -else - arch_args = [] + c_args += '-mfpu=neon' endif -add_project_arguments(arch_args, language: 'c') +add_project_arguments(c_args, language: 'c') cc = meson.get_compiler('c')