diff options
author | Chun-wei Fan <fanchunwei@src.gnome.org> | 2019-07-19 18:47:13 +0800 |
---|---|---|
committer | Chun-wei Fan <fanchunwei@src.gnome.org> | 2019-07-19 18:47:13 +0800 |
commit | da059347f8df5fc180b4538d9d3c50867c401fbd (patch) | |
tree | 11065fb0bddbaadfe0fff506827c92f782185a5c /meson.build | |
parent | 24e079c3ef47702a38266d404aac204b701038ad (diff) | |
download | pango-da059347f8df5fc180b4538d9d3c50867c401fbd.tar.gz |
build: Only use fallback dep for FontConfig when needed/requested
Windows and macOS only optionally requires FontConfig, so:
-Add an option, for Windows and macOS, whether we want to use FontConfig
on these platforms. This is ignored on *NIX, where FontConfig will
always be used.
-We still look for FontConfig first via pkg-config files, and on MSVC
builds, via looking for its headers and .lib files. If FontConfig is
required (or requested) but is not found, we then use the fallback
dependency for it.
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/meson.build b/meson.build index 13d9bbff..694c0a19 100644 --- a/meson.build +++ b/meson.build @@ -259,8 +259,10 @@ if harfbuzz_dep.found() pango_deps += harfbuzz_dep endif -fontconfig_dep = dependency('fontconfig', version: fontconfig_req_version, required: false, - fallback: ['fontconfig', 'fontconfig_dep']) +# Only use FontConfig fallback when required or requested +fontconfig_required = (host_system != 'windows' and host_system != 'darwin') or get_option('use_fontconfig') + +fontconfig_dep = dependency('fontconfig', version: fontconfig_req_version, required: false) if fontconfig_dep.found() fontconfig_pc = 'fontconfig' else @@ -274,6 +276,11 @@ else endif endif +if fontconfig_required and not fontconfig_dep.found() + fontconfig_dep = dependency('fontconfig', version: fontconfig_req_version, + fallback: ['fontconfig', 'fontconfig_dep']) +endif + if fontconfig_dep.found() pango_deps += fontconfig_dep |