[gnome-settings-daemon/wip/lantw/meson-Check-for-debug-and-optimization-in-the-same-way-as-GTK-4] meson: Check for debug and optimization in the same way as GTK 4
- From: Ting-Wei Lan <lantw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon/wip/lantw/meson-Check-for-debug-and-optimization-in-the-same-way-as-GTK-4] meson: Check for debug and optimization in the same way as GTK 4
- Date: Sun, 3 May 2020 10:35:36 +0000 (UTC)
commit 6b968a8d62c02ed7182855a242de33110dabcee9
Author: Ting-Wei Lan <lantw src gnome org>
Date: Sun May 3 18:30:15 2020 +0800
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.
meson.build | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/meson.build b/meson.build
index 851341d7..cb5db8b1 100644
--- a/meson.build
+++ b/meson.build
@@ -30,8 +30,6 @@ gsd_schemadir = join_paths(gsd_datadir, 'glib-2.0', 'schemas')
gsd_xdg_autostart = join_paths(gsd_sysconfdir, 'xdg', 'autostart')
-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')
@@ -56,7 +54,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 = [
@@ -70,7 +68,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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]