* meson.build: Use `meson.override_dependency`. This is a new meson mechanism to avoid other projects to hard-code the `freetype2_dep` variable name in their build definition. It also ensures that meson does not mix system and subproject versions of FreeType inside of the same project. Also remove outdated TODO because `declare_dependency` was already there.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
diff --git a/ChangeLog b/ChangeLog
index 57704cc..1312b04 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
2021-02-09 Xavier Claessens <xavier.claessens@collabora.com>
+ * meson.build: Use `meson.override_dependency`.
+
+ This is a new meson mechanism to avoid other projects to hard-code
+ the `freetype2_dep` variable name in their build definition. It
+ also ensures that meson does not mix system and subproject versions
+ of FreeType inside of the same project.
+
+ Also remove outdated TODO because `declare_dependency` was already
+ there.
+
+2021-02-09 Xavier Claessens <xavier.claessens@collabora.com>
+
* meson.build (bzip2_dep): Simplify.
We remove `static:false` from `find_library('bz2')`.
diff --git a/meson.build b/meson.build
index 243046c..30b03bb 100644
--- a/meson.build
+++ b/meson.build
@@ -334,6 +334,7 @@ freetype2_dep = declare_dependency(
include_directories: ft2_includes,
link_with: ft2_lib,
version: ft2_so_version)
+meson.override_dependency('freetype2', freetype2_dep)
# NOTE: Using both `install_dir` and `subdir` doesn't seem to work below,
@@ -347,8 +348,6 @@ install_headers(ft2_config_headers,
install_dir: 'include/freetype2/freetype/config')
-# TODO(david): Declare_dependency() for using this in a Meson subproject
-#
pkgconfig = import('pkgconfig')
pkgconfig.generate(ft2_lib,
filebase: 'freetype2',