From 25ab87d8e599b4f07842d342cb5fb06b3aa6247b Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Thu, 5 May 2022 19:24:30 +0100 Subject: [PATCH] build: Drop checks and workarounds for older Meson versions Signed-off-by: Philip Withnall --- .gitlab-ci.yml | 13 +++---------- docs/reference/meson.build | 3 --- gio/meson.build | 31 +++++++++---------------------- glib/meson.build | 13 ++++--------- gmodule/meson.build | 8 +++----- gobject/meson.build | 13 ++++--------- gthread/meson.build | 5 +---- meson.build | 13 ------------- 8 files changed, 24 insertions(+), 75 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ad68f6c33..26428dfd0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -17,8 +17,7 @@ variables: MINGW_IMAGE: "registry.gitlab.gnome.org/gnome/glib/mingw:v5" MESON_TEST_TIMEOUT_MULTIPLIER: 2 G_MESSAGES_DEBUG: all - MESON_COMMON_OPTIONS_NO_WARNING: "--buildtype debug --wrap-mode=nodownload" - MESON_COMMON_OPTIONS: "${MESON_COMMON_OPTIONS_NO_WARNING} --fatal-meson-warnings" + MESON_COMMON_OPTIONS: "--buildtype debug --wrap-mode=nodownload --fatal-meson-warnings" .only-default: only: @@ -72,10 +71,7 @@ fedora-x86_64: variables: CFLAGS: "-coverage -ftest-coverage -fprofile-arcs" script: - # FIXME: Cannot use MESON_COMMON_OPTIONS here because meson warns about gtkdoc - # feature fully functional in 0.54, but we only depend on 0.52. So we cannot build - # with --fatal-meson-warnings. - - meson ${MESON_COMMON_OPTIONS_NO_WARNING} + - meson ${MESON_COMMON_OPTIONS} --werror --default-library=both --prefix=$HOME/glib-installed @@ -564,10 +560,7 @@ dist-job: only: - tags script: - # FIXME: Cannot use MESON_COMMON_OPTIONS here because meson warns about gtkdoc - # feature fully functional in 0.54, but we only depend on 0.52. So we cannot build - # with --fatal-meson-warnings. - - meson ${MESON_COMMON_OPTIONS_NO_WARNING} --buildtype release -Dgtk_doc=true -Dman=true _build + - meson ${MESON_COMMON_OPTIONS} --buildtype release -Dgtk_doc=true -Dman=true _build - cd _build - ninja dist - ninja glib-doc gobject-doc gio-doc diff --git a/docs/reference/meson.build b/docs/reference/meson.build index 1bc97a2f6..564e1ca2a 100644 --- a/docs/reference/meson.build +++ b/docs/reference/meson.build @@ -47,9 +47,6 @@ gtkdoc_common_scan_args = [ ] if get_option('gtk_doc') - if not meson.version().version_compare('>=0.52.0') - error('Building documentation requires Meson >= 0.52.0.') - endif # Check we have the minimum gtk-doc version required. Older versions won't # generate correct documentation. dependency('gtk-doc', version : '>=1.32.1', diff --git a/gio/meson.build b/gio/meson.build index 9df7bdd67..ccd4c417d 100644 --- a/gio/meson.build +++ b/gio/meson.build @@ -829,17 +829,12 @@ schemas_subdir = join_paths('glib-2.0', 'schemas') libgio_dep = declare_dependency(link_with : libgio, dependencies : [libgmodule_dep, libgobject_dep, gioenumtypes_dep], - include_directories : [gioinc]) - -# Work around variables kwarg requiring Meson 0.56 -if meson.version().version_compare('>=0.56.0') - libgio_dep = declare_dependency(dependencies: libgio_dep, - variables: [ - 'schemasdir=' + join_paths(glib_datadir, schemas_subdir), - 'giomoduledir=' + glib_giomodulesdir, - ] - ) -endif + include_directories : [gioinc], + variables : [ + 'schemasdir=' + join_paths(glib_datadir, schemas_subdir), + 'giomoduledir=' + glib_giomodulesdir, + ], +) pkg.generate(libgio, requires : ['glib-2.0', 'gobject-2.0'], @@ -861,11 +856,7 @@ pkg.generate(libgio, name : 'GIO', description : 'glib I/O library', ) - -if meson.version().version_compare('>=0.54.0') - meson.override_dependency('gio-2.0', libgio_dep) -endif - +meson.override_dependency('gio-2.0', libgio_dep) if host_system == 'windows' pkg.generate(requires : ['gobject-2.0', 'gmodule-no-export-2.0', 'gio-2.0'], @@ -876,9 +867,7 @@ if host_system == 'windows' name : 'GIO Windows specific APIs', description : 'Windows specific headers for glib I/O library', ) - if meson.version().version_compare('>=0.54.0') - meson.override_dependency('gio-windows-2.0', libgio_dep) - endif + meson.override_dependency('gio-windows-2.0', libgio_dep) else pkg.generate(requires : ['gobject-2.0', 'gio-2.0'], subdirs : ['gio-unix-2.0'], @@ -888,9 +877,7 @@ else name : 'GIO unix specific APIs', description : 'unix specific headers for glib I/O library', ) - if meson.version().version_compare('>=0.54.0') - meson.override_dependency('gio-unix-2.0', libgio_dep) - endif + meson.override_dependency('gio-unix-2.0', libgio_dep) endif if host_system == 'windows' diff --git a/glib/meson.build b/glib/meson.build index 93fa5049a..2eb97d748 100644 --- a/glib/meson.build +++ b/glib/meson.build @@ -401,10 +401,7 @@ pkg.generate(libglib, name : 'GLib', description : 'C Utility Library', ) - -if meson.version().version_compare('>=0.54.0') - meson.override_dependency('glib-2.0', libglib_dep) -endif +meson.override_dependency('glib-2.0', libglib_dep) # On Windows, glib needs a spawn helper for g_spawn* API if host_system == 'windows' @@ -453,11 +450,9 @@ configure_file( install_data('glib_gdb.py', install_dir : join_paths(glib_pkgdatadir, 'gdb')) # This is needed to make gdb find glib_gdb.py -if meson.version().version_compare('>=0.58') - env = environment() - env.prepend('PYTHONPATH', meson.current_source_dir()) - meson.add_devenv(env) -endif +env = environment() +env.prepend('PYTHONPATH', meson.current_source_dir()) +meson.add_devenv(env) gdb_conf = configuration_data() gdb_conf.set('datadir', glib_datadir) diff --git a/gmodule/meson.build b/gmodule/meson.build index f0e7e12a1..7a18d8868 100644 --- a/gmodule/meson.build +++ b/gmodule/meson.build @@ -126,11 +126,9 @@ libgmodule_dep = declare_dependency(link_with : libgmodule, include_directories : [gmoduleinc], dependencies : [libglib_dep]) -if meson.version().version_compare('>=0.54.0') - meson.override_dependency('gmodule-no-export-2.0', libgmodule_dep) - meson.override_dependency('gmodule-export-2.0', libgmodule_dep) - meson.override_dependency('gmodule-2.0', libgmodule_dep) -endif +meson.override_dependency('gmodule-no-export-2.0', libgmodule_dep) +meson.override_dependency('gmodule-export-2.0', libgmodule_dep) +meson.override_dependency('gmodule-2.0', libgmodule_dep) if build_tests subdir('tests') diff --git a/gobject/meson.build b/gobject/meson.build index 026a0351e..07d096f36 100644 --- a/gobject/meson.build +++ b/gobject/meson.build @@ -150,10 +150,7 @@ pkg.generate(libgobject, libgobject_dep = declare_dependency(link_with : libgobject, include_directories : [gobjectinc], dependencies : [libglib_dep, glib_enumtypes_dep]) - -if meson.version().version_compare('>=0.54.0') - meson.override_dependency('gobject-2.0', libgobject_dep) -endif +meson.override_dependency('gobject-2.0', libgobject_dep) executable('gobject-query', 'gobject-query.c', install : true, @@ -171,11 +168,9 @@ configure_file( ) # This is needed to make gdb find gobject_gdb.py -if meson.version().version_compare('>=0.58') - env = environment() - env.prepend('PYTHONPATH', meson.current_source_dir()) - meson.add_devenv(env) -endif +env = environment() +env.prepend('PYTHONPATH', meson.current_source_dir()) +meson.add_devenv(env) if enable_systemtap gobject_stp = configure_file(input : 'gobject.stp.in', diff --git a/gthread/meson.build b/gthread/meson.build index 808e889cc..94a9ce5b5 100644 --- a/gthread/meson.build +++ b/gthread/meson.build @@ -34,7 +34,4 @@ pkg.generate(libgthread, ) libgthread_dep = declare_dependency(link_with : libgthread) - -if meson.version().version_compare('>=0.54.0') - meson.override_dependency('gthread-2.0', libgthread_dep) -endif +meson.override_dependency('gthread-2.0', libgthread_dep) diff --git a/meson.build b/meson.build index 1d5abc1a3..c88ef8c97 100644 --- a/meson.build +++ b/meson.build @@ -662,19 +662,6 @@ if host_system != 'windows' and cc.has_function('stpcpy', prefix : '#include = 21 - #error Android is 21 or newer - #endif''') - if android_is_older and meson.version().version_compare('< 0.54.2') - error('Compiling for \n#include ') glib_conf.set('HAVE_MEMALIGN', 1) endif