Skip to content

Commit eadcc84

Browse files
committed
Default b_ndebug to true, and undefine NDEBUG only for debug builds
1 parent 1bb83af commit eadcc84

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

meson.build

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ project('SU2', 'c', 'cpp',
55
license: 'LGPL2',
66
default_options: ['buildtype=release',
77
'warning_level=0',
8-
'b_ndebug=if-release',
8+
'b_ndebug=true',
99
'c_std=c99',
1010
'cpp_std=c++17'])
1111

@@ -52,6 +52,13 @@ if build_machine.system() != 'windows'
5252
endif
5353
endif
5454

55+
# Handle assertions: default is b_ndebug=true (assertions disabled)
56+
# but for debug builds, we want to enable assertions
57+
if get_option('buildtype') == 'debug'
58+
# Undefine NDEBUG
59+
su2_cpp_args += '-UNDEBUG'
60+
endif
61+
5562
# meson script path
5663
script_path = meson.project_source_root() / 'meson_scripts'
5764

0 commit comments

Comments
 (0)