summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2022-05-02 18:51:02 +0200
committerThomas Haller <thaller@redhat.com>2022-05-03 10:20:57 +0200
commit9e1cbec512c147d7d51e1bd7b55ecbf4a2098294 (patch)
treeb8cd5f4960bba102d12d2951068febeae7a78a5a
parent28f8320c66e506fd460fd979ebca93d98ff2464e (diff)
downloadNetworkManager-th/nm-1-38.tar.gz
build/meson: avoid compiler warning generating "NM-1.0.gir"th/nm-1-38
In glib_dep we specify "-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_40 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_40" which is the dependency we use almost everywhere. With g-ir-scanner this causes compiler warnings: [xxx] Generating NM-1.0.gir with a custom command /src/NetworkManager/build/tmp-introspectnas6f9u5/NM-1.0.c: In function ‘dump_object_type’: /src/NetworkManager/build/tmp-introspectnas6f9u5/NM-1.0.c:252:13: warning: Not available before 2.70 252 | if (G_TYPE_IS_FINAL (type)) | ^~~~~~~~~~~~~~~~~ /src/NetworkManager/build/tmp-introspectnas6f9u5/NM-1.0.c: In function ‘dump_fundamental_type’: /src/NetworkManager/build/tmp-introspectnas6f9u5/NM-1.0.c:370:13: warning: Not available before 2.70 370 | if (G_TYPE_IS_FINAL (type)) | ^~~~~~~~~~~~~~~~~ g-ir-scanner: link: gcc -o /src/NetworkManager/build/tmp-introspectnas6f9u5/NM-1.0 /src/NetworkManager/build/tmp-introspectnas6f9u5/NM-1.0.o -L. -Wl,-rpath,. -Wl,--no-as-needed -L/src/NetworkManager/build/src/libnm-client-impl -Wl,-rpath,/src/NetworkManager/build/src/libnm-client-impl -lnm -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lgmodule-2.0 -ludev -lgirepository-1.0 -lgio-2.0 -lgobject-2.0 -Wl,--export-dynamic -lgmodule-2.0 -pthread -lglib-2.0 -lglib-2.0 Work around that. Meson's gnome.generate_gir() is not very flexibly in allowing to pass extra `--cflags-begin {} --cflags-end` parameters. Hack around by adding a pseudo dependency that resets these defines. See-also: https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/331 See-also: 1234e5583a09 ('build/autotools: avoid compiler warning generating "NM-1.0.gir"') (cherry picked from commit e5d4194673073e6897a2514f326f245b8688bcc2)
-rw-r--r--src/libnm-client-impl/meson.build8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libnm-client-impl/meson.build b/src/libnm-client-impl/meson.build
index 21a01e0b04..2026f98dc3 100644
--- a/src/libnm-client-impl/meson.build
+++ b/src/libnm-client-impl/meson.build
@@ -140,6 +140,14 @@ if enable_introspection
src_inc,
top_inc,
],
+ dependencies: [
+ declare_dependency(
+ compile_args: [
+ '-UGLIB_VERSION_MIN_REQUIRED',
+ '-UGLIB_VERSION_MAX_ALLOWED',
+ ],
+ ),
+ ],
nsversion: nm_gir_version,
namespace: 'NM',
identifier_prefix: nm_id_prefix,