aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mesonbuild/compilers.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/mesonbuild/compilers.py b/mesonbuild/compilers.py
index fb2a81a..4ee94d6 100644
--- a/mesonbuild/compilers.py
+++ b/mesonbuild/compilers.py
@@ -173,6 +173,9 @@ base_options = {
'b_colorout' : coredata.UserComboOption('b_colorout', 'Use colored output',
['auto', 'always', 'never'],
'always'),
+ 'b_ndebug' : coredata.UserBooleanOption('b_ndebug',
+ 'Disable asserts',
+ False)
}
def sanitizer_compile_args(value):
@@ -218,6 +221,11 @@ def get_base_compile_args(options, compiler):
args += compiler.get_coverage_args()
except KeyError:
pass
+ try:
+ if options['b_ndebug'].value:
+ args += ['-DNDEBUG']
+ except KeyError:
+ pass
return args
def get_base_link_args(options, linker):
@@ -1953,7 +1961,7 @@ class GnuCompiler:
self.id = 'gcc'
self.gcc_type = gcc_type
self.base_options = ['b_pch', 'b_lto', 'b_pgo', 'b_sanitize', 'b_coverage',
- 'b_colorout']
+ 'b_colorout', 'b_ndebug']
if self.gcc_type != GCC_OSX:
self.base_options.append('b_lundef')
self.base_options.append('b_asneeded')
@@ -2084,7 +2092,8 @@ class ClangCompiler():
def __init__(self, clang_type):
self.id = 'clang'
self.clang_type = clang_type
- self.base_options = ['b_pch', 'b_lto', 'b_pgo', 'b_sanitize', 'b_coverage']
+ self.base_options = ['b_pch', 'b_lto', 'b_pgo', 'b_sanitize', 'b_coverage',
+ 'b_ndebug']
if self.clang_type != CLANG_OSX:
self.base_options.append('b_lundef')
self.base_options.append('b_asneeded')