From 12171f6fe770fa9bdbafaf0d87b6d9361a6ec8b5 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Fri, 28 Feb 2025 11:52:09 +0000 Subject: [PATCH 1/2] tests: Don't check for missing install_tag if GLib is a subproject The test script checks the entire Meson build, not just GLib, so it will fail if GLib is a fallback subproject within some larger project that does not use `install_tag` as systematically as GLib does. In particular, if the larger project has a very conservative minimum Meson version (like for example dbus), it might not be possible to add `install_tag` to it. Resolves: https://gitlab.gnome.org/GNOME/glib/-/issues/3625 Signed-off-by: Simon McVittie --- tests/meson.build | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/tests/meson.build b/tests/meson.build index 42162f4c3..2ea32e8a0 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -25,13 +25,15 @@ if have_bash endforeach endif -test( - 'check-missing-install-tag.py', - python, - args : ['-B', files('check-missing-install-tag.py')], - env : test_env, - suite : ['lint', 'no-valgrind'], - protocol : 'tap', -) +if not meson.is_subproject() + test( + 'check-missing-install-tag.py', + python, + args : ['-B', files('check-missing-install-tag.py')], + env : test_env, + suite : ['lint', 'no-valgrind'], + protocol : 'tap', + ) +endif subdir('lib') From 66bca5f78bc867ba885ceab3c5bcd7711c88fa08 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Fri, 28 Feb 2025 11:58:00 +0000 Subject: [PATCH 2/2] build: If pcre2 is a subproject, disable its unit tests by default Debugging pcre2's test suite is out-of-scope for GLib, or for any larger project that embeds GLib as a subproject. Resolves: https://gitlab.gnome.org/GNOME/glib/-/issues/3626 Signed-off-by: Simon McVittie --- meson.build | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 29df15217..5de87d235 100644 --- a/meson.build +++ b/meson.build @@ -2225,9 +2225,13 @@ else endif pcre2_req = '>=10.32' +pcre2_options = [ + 'default_library=static', + 'test=false', +] # Pick up pcre from the system, or if "--force-fallback-for libpcre2-8" was specified -pcre2 = dependency('libpcre2-8', version: pcre2_req, required: false, default_options: ['default_library=static']) +pcre2 = dependency('libpcre2-8', version: pcre2_req, required: false, default_options: pcre2_options) if not pcre2.found() if cc.get_id() == 'msvc' or cc.get_id() == 'clang-cl' # MSVC: Search for the PCRE2 library by the configuration, which corresponds @@ -2243,7 +2247,7 @@ endif # Try again with the fallback if not pcre2.found() - pcre2 = dependency('libpcre2-8', version: pcre2_req, allow_fallback: true, default_options: ['default_library=static']) + pcre2 = dependency('libpcre2-8', version: pcre2_req, allow_fallback: true, default_options: pcre2_options) assert(pcre2.type_name() == 'internal') # static flags are automatically enabled by the subproject if it's built # with default_library=static