summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-09-08 18:35:56 +0200
committerThomas Haller <thaller@redhat.com>2020-09-08 18:40:57 +0200
commitb867ac56a48167fb3263fbe569898e7b16c18ca3 (patch)
tree4e390c478cc7bf383bf969bf831be4b234698575
parent391820da7678d7ee87ac6d1c0a806bbe38002f04 (diff)
downloadNetworkManager-b867ac56a48167fb3263fbe569898e7b16c18ca3.tar.gz
build/meson: enable "more_asserts" only for devel builds
more_asserts are our NetworkManager specific assertions, and the only point of having them at all (beside g_assert(), assert() and g_return*()), is that these assertions are disabled by default in production. meson always enabled them by default. That is definitely wrong. autotools enables more_asserts by default if we build a devel version from master. I think that is bad too, because (again) having these assertions disabled by default is the only point of having them. Anyway, mimic the behavior of autotools, to at least disable them in release builds.
-rw-r--r--meson.build7
-rw-r--r--meson_options.txt2
2 files changed, 8 insertions, 1 deletions
diff --git a/meson.build b/meson.build
index 28913600d2..ffb0cb87dc 100644
--- a/meson.build
+++ b/meson.build
@@ -750,6 +750,13 @@ if enable_nm_cloud_setup
endif
more_asserts = get_option('more_asserts')
+if more_asserts == 'auto'
+ if nm_minor_version % 2 == 0
+ more_asserts = 'no'
+ else
+ more_asserts = 'all'
+ endif
+endif
if more_asserts == 'no'
more_asserts = 0
elif more_asserts == 'all'
diff --git a/meson_options.txt b/meson_options.txt
index 8d243974d3..d4f62829fa 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -63,7 +63,7 @@ option('vapi', type : 'combo', choices : ['auto', 'true', 'false'], description:
option('docs', type: 'boolean', value: false, description: 'use to build documentation')
option('tests', type: 'combo', choices: ['yes', 'no', 'root'], value: 'yes', description: 'Build NetworkManager tests')
option('firewalld_zone', type: 'boolean', value: true, description: 'Install and use firewalld zone for shared mode')
-option('more_asserts', type: 'string', value: 'all', description: 'Enable more assertions for debugging (0 = no, 100 = all, default: all)')
+option('more_asserts', type: 'string', value: 'auto', description: 'Enable more assertions for debugging (0 = no, 100 = all, default: auto)')
option('more_logging', type: 'boolean', value: true, description: 'Enable more debug logging')
option('valgrind', type: 'array', value: ['no'], description: 'Use valgrind to memory-check the tests')
option('valgrind_suppressions', type: 'string', value: '', description: 'Use specific valgrind suppression file')