From 966aeb5ee3f154ce8deebc093907e2dc09d3b4fe Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Sat, 17 Aug 2024 23:24:07 -0400 Subject: [PATCH] build: Override dependency for use as subproject A pkgconfig file is already provided, which enables using `thorvg` once it is installed. However, this file is not, and cannot be, available at setup time if using `thorvg` as a subproject. In such cases, Meson provides the `override_dependency` mechanism for a subproject to tell its parent how to use it. --- inc/meson.build | 2 ++ src/meson.build | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/inc/meson.build b/inc/meson.build index e9d002dd..701f3859 100644 --- a/inc/meson.build +++ b/inc/meson.build @@ -1,3 +1,5 @@ header_files = ['thorvg.h'] +thorvg_inc = include_directories('.') + install_headers(header_files) diff --git a/src/meson.build b/src/meson.build index f1ec7f2f..b13b0015 100644 --- a/src/meson.build +++ b/src/meson.build @@ -62,6 +62,12 @@ thorvg_lib = library( override_options : override_options ) +thorvg_dep = declare_dependency( + include_directories: thorvg_inc, + link_with: thorvg_lib, +) +meson.override_dependency('thorvg', thorvg_dep) + pkg_mod = import('pkgconfig') pkg_mod.generate(