summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTing-Wei Lan <lantw@src.gnome.org>2020-05-03 18:30:15 +0800
committerTing-Wei Lan <lantw@src.gnome.org>2022-04-30 12:24:47 +0800
commitb5b22f8240e352fdcc25f79b929b79b26db44bfe (patch)
tree9de37dde6fef1d8236c55abd247d5179a49ec007
parent64ac7fc58f87971f12d2957433788567448a61cc (diff)
downloadgnome-settings-daemon-wip/lantw/meson-Check-for-debug-and-optimization-in-the-same-way-as-GTK-4.tar.gz
meson: Check for debug and optimization in the same way as GTK 4wip/lantw/meson-Check-for-debug-and-optimization-in-the-same-way-as-GTK-4
Now meson returns 'custom' as the 'buildtype' when the user sets 'optimization' and 'debug' to a combination it does not know, making it more likely to have none of 'debug' and 'release' in 'buildtype'. Therefore, it should be better to use 'optimization' and 'debug' options directly if we don't want an explicit option to control it.
-rw-r--r--meson.build6
1 files changed, 2 insertions, 4 deletions
diff --git a/meson.build b/meson.build
index a8955a49..cb691077 100644
--- a/meson.build
+++ b/meson.build
@@ -36,8 +36,6 @@ gsd_xdg_autostart = join_paths(gsd_sysconfdir, 'xdg', 'autostart')
gsd_3_0_api_name = '@0@-@1@'.format(meson.project_name(), '3.0')
gsd_gtk_modules_directory = join_paths(gsd_libdir, gsd_3_0_api_name, 'gtk-modules')
-gsd_buildtype = get_option('buildtype')
-
host_is_darwin = host_machine.system().contains('darwin')
host_is_linux = host_machine.system().contains('linux')
host_is_linux_not_s390 = host_is_linux and not host_machine.cpu().contains('s390')
@@ -62,7 +60,7 @@ endforeach
common_flags = ['-DHAVE_CONFIG_H']
compiler_flags = []
-if gsd_buildtype.contains('debug')
+if get_option('debug')
common_flags += ['-DG_ENABLE_DEBUG']
test_cflags = [
@@ -78,7 +76,7 @@ if gsd_buildtype.contains('debug')
]
compiler_flags = cc.get_supported_arguments(test_cflags)
-elif gsd_buildtype.contains('release')
+elif get_option('optimization') in ['2', '3', 's']
common_flags += ['-DG_DISABLE_CAST_CHECKS']
endif