aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2021-10-25 09:52:39 -0700
committerEmil Velikov <emil.l.velikov@gmail.com>2021-11-30 21:26:17 +0000
commit950a1f35a718bc2a8e1dda75845e52651bb331a7 (patch)
tree63d7fde473130460f78f3cb2943de504f3e3b50c
parent64c7b5417ee91de2b2ea31a127f003c4bfa4973c (diff)
downloadwaffle-950a1f35a718bc2a8e1dda75845e52651bb331a7.tar.gz
meson: use override_dependency and override_find_program
This allows automatic overrides of the waffle-1 dependency and wflifo program, when used as a subproject/dependency fallback without having to specify them in the consumer, as is current meson best practice. For projects using meson > 0.54, they can then just write: ```meson dependency('waffle-1') ``` and if they have the waffle-1 wrap installed then meson will automatically configure the project, and use the built libwaffle-1, without having to specify fallback parameters in the calling meson.build. This is quite similar to the find_program_override, which works for executables instead of dependencies.
-rw-r--r--src/utils/meson.build4
-rw-r--r--src/waffle/meson.build4
2 files changed, 8 insertions, 0 deletions
diff --git a/src/utils/meson.build b/src/utils/meson.build
index 5462355..bb802d5 100644
--- a/src/utils/meson.build
+++ b/src/utils/meson.build
@@ -44,4 +44,8 @@ if not build_nacl
dependencies : [dep_cocoa, idep_getopt],
install : true,
)
+
+ if meson.version().version_compare('>= 0.46.0')
+ meson.override_find_program('wflinfo', wflinfo)
+ endif
endif
diff --git a/src/waffle/meson.build b/src/waffle/meson.build
index 7e0be27..fc754ec 100644
--- a/src/waffle/meson.build
+++ b/src/waffle/meson.build
@@ -227,6 +227,10 @@ ext_waffle = declare_dependency(
include_directories : [inc_waffle, inc_include],
)
+if meson.version().version_compare('>= 0.54.0')
+ meson.override_dependency(waffle_name, ext_waffle)
+endif
+
pkg = import('pkgconfig')
pkg.generate(
libwaffle,