summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorChun-wei Fan <fanchunwei@src.gnome.org>2019-07-15 11:42:52 +0800
committerChun-wei Fan <fanchunwei@src.gnome.org>2019-07-15 12:18:43 +0800
commit95c645f521654d21c409be1786bcc3d25a56e56e (patch)
tree62a08cc0a27cb5aaa6dc7c2b31904f7b6746f224 /meson.build
parent037ad011d2dc1b23374ca8cd1ed9dcf5b90230ba (diff)
downloadpango-95c645f521654d21c409be1786bcc3d25a56e56e.tar.gz
build: Only use fallback dependency for HarfBuzz when needed
Unfortunately the CMake dependency discovery mechanism is broken in Meson, so on MSVC builds we still look first for the HarfBuzz headers and .lib's, and ensure that they are 2.0.0 or later, before we try to use the fallback dependency. We do, however, want to make use of the fallback if HarfBuzz cannot be found since HarfBuzz is now a hard dependency of Pango for all builds.
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build23
1 files changed, 16 insertions, 7 deletions
diff --git a/meson.build b/meson.build
index 73b5da2b..13d9bbff 100644
--- a/meson.build
+++ b/meson.build
@@ -229,23 +229,32 @@ harfbuzz_pc=''
freetype2_pc=''
fontconfig_pc=''
harfbuzz_lib=''
-freetype2_lib=''
fontconfig_lib=''
-harfbuzz_dep = dependency('harfbuzz', version: harfbuzz_req_version, required: false,
- fallback: ['harfbuzz', 'libharfbuzz_dep'])
+harfbuzz_dep = dependency('harfbuzz', version: harfbuzz_req_version, required: false)
if harfbuzz_dep.found()
harfbuzz_pc = 'harfbuzz'
else
if cc.get_id() == 'msvc' and cc.has_header('hb.h')
# The CMake build files for HarfBuzz (which is used for MSVC builds) do not
- # generate pkg-config files, so look for harfbuzz.lib
- harfbuzz_dep = cc.find_library('harfbuzz', required: false)
- if harfbuzz_dep.found()
- harfbuzz_lib = '-lharfbuzz'
+ # generate pkg-config files, so look for harfbuzz.lib. Ensure that we
+ # we look for HarfBuzz 2.0.0 or later.
+ harfbuzz_lib = cc.find_library('harfbuzz', required: false)
+ if harfbuzz_lib.found()
+ if cc.has_function('hb_ot_tags_from_script_and_language', dependencies: harfbuzz_lib)
+ harfbuzz_dep = harfbuzz_lib
+ endif
endif
endif
endif
+
+# Remove when Meson acquires ability to declare deps declaratively, or
+# when finding dependencies via CMake files is fixed.
+if not harfbuzz_dep.found()
+ harfbuzz_dep = dependency('harfbuzz', version: harfbuzz_req_version,
+ fallback: ['harfbuzz', 'libharfbuzz_dep'])
+endif
+
if harfbuzz_dep.found()
pango_deps += harfbuzz_dep
endif