From 767d7c65be4a16fc00929a19d843ddaf78e2533e Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Wed, 27 Nov 2024 18:04:35 +0100 Subject: [PATCH] fix(linux): disable assertions in release builds This change uses the G_DISABLE_ASSERT flag to disable assertions for release builds. See https://docs.gtk.org/glib/func.assert.html --- linux/ibus-keyman/meson.build | 5 +++++ linux/ibus-keyman/src/meson.build | 2 ++ 2 files changed, 7 insertions(+) diff --git a/linux/ibus-keyman/meson.build b/linux/ibus-keyman/meson.build index 763a121245f..98281849e82 100644 --- a/linux/ibus-keyman/meson.build +++ b/linux/ibus-keyman/meson.build @@ -8,6 +8,11 @@ project('ibus-keyman', 'c', 'cpp', # meson doesn't allow us to reference a file outside its root subdir('resources') +if get_option('buildtype') != 'debug' + # Disable assertions on release builds + defns += ['-DG_DISABLE_ASSERT'] +endif + conf = configuration_data() ibus = dependency('ibus-1.0', version: '>= 1.2.0') diff --git a/linux/ibus-keyman/src/meson.build b/linux/ibus-keyman/src/meson.build index 2b436caef60..13b3caafc09 100644 --- a/linux/ibus-keyman/src/meson.build +++ b/linux/ibus-keyman/src/meson.build @@ -40,6 +40,8 @@ configure_file( exe = executable( 'ibus-engine-keyman', + c_args: defns, + cpp_args: defns, sources: [engine_files, util_files], dependencies: deps, include_directories: include_dirs,