From 755880f8281af4297751c41ec95a966cf5c6644e Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Sun, 18 Dec 2022 09:53:21 +0530 Subject: [PATCH] meson: Override dependencies to improve usage as a subproject With this change, libcloudproviders can be consumed as a subproject without making any changes to the build files of a project. All you need to do is provide a wrap file with a `[provide]` section: https://mesonbuild.com/Wrap-dependency-system-manual.html#provide-section This is also necessary because otherwise projects need to hard-code the subproject name, which might be `libcloudproviders` when using `wrap-git` or `libcloudproviders-0.3.1` when using `wrap-file` (to build from a release tarball). This can cause conflicts between different subprojects that consume libcloudproviders differently. Other projects like glib, cairo, pango, etc already do this. Required a meson version bump to 0.54, which was released almost three years ago. --- meson.build | 2 +- src/meson.build | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 2a52382..29307b2 100644 --- a/meson.build +++ b/meson.build @@ -1,6 +1,6 @@ project ('libcloudproviders', 'c', version: '0.3.1', - meson_version: '>=0.47.0', + meson_version: '>=0.54.0', license: 'LGPL3+', default_options: [ 'c_std=gnu99', diff --git a/src/meson.build b/src/meson.build index aca1929..74476a4 100644 --- a/src/meson.build +++ b/src/meson.build @@ -56,6 +56,7 @@ libcloudproviders_dep = declare_dependency ( dependencies: libcloudproviders_deps, include_directories: include_directories('.') ) +meson.override_dependency('libcloudproviders', libcloudproviders_dep) if get_option('introspection') libcloudproviders_gir = gnome.generate_gir( -- GitLab