summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--meson.build11
-rw-r--r--meson_options.txt4
2 files changed, 13 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
diff --git a/meson_options.txt b/meson_options.txt
index d2f5f302..7a59fa2b 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -10,3 +10,7 @@ option('install-tests',
description : 'Install tests',
type: 'boolean',
value: 'false')
+option('use_fontconfig',
+ description : 'Force using FontConfig where it is optional, on Windows and macOS. This is ignored on platforms where it is required',
+ type: 'boolean',
+ value: 'false')