summaryrefslogtreecommitdiff
path: root/pango
diff options
context:
space:
mode:
authorChun-wei Fan <fanchunwei@src.gnome.org>2021-02-25 16:40:41 +0800
committerChun-wei Fan <fanchunwei@src.gnome.org>2021-02-25 16:40:41 +0800
commit09bf1b41b40151044644d0e35ba9949007fc83cd (patch)
tree072568a298dab883ea052d7cdff3bcb38eafbfea /pango
parent4dfe591823eec1d5f702a909ae9206f5fa5cb47d (diff)
downloadpango-09bf1b41b40151044644d0e35ba9949007fc83cd.tar.gz
build: Don't build HarfBuzz prematurelyhb-dont-fallback-too-early
For Visual Studio builds, since HarfBuzz is built with CMake until HarfBuzz 2.6.x yet we only require HarfBuzz 2.0.0 or later, we aren't able to find pre-2.6.x HarfBuzz using Meson's dependency() method as the support for CMake config files is not done in Meson. As a result, we need to make sure that we first manually look for the HarfBuzz/HarfBuzz-GObject libraries before we attempt to use the fallback mechanism in Meson, so that we won't rebuild HarfBuzz unneccesarily. This rebuild will also cause issues for older compilers that don't have enough support for C++11 as building Harfbuzz with Meson support requires a C++11 compiler, which was mandated in HarfBuzz 2.5.0.
Diffstat (limited to 'pango')
-rw-r--r--pango/meson.build15
1 files changed, 13 insertions, 2 deletions
diff --git a/pango/meson.build b/pango/meson.build
index 777f5374..e5121bd8 100644
--- a/pango/meson.build
+++ b/pango/meson.build
@@ -129,8 +129,19 @@ if build_gir
gir_args = [
'--quiet',
]
- harfbuzz_gobject_dep = dependency('harfbuzz-gobject', version: harfbuzz_req_version, required: false,
- fallback: ['harfbuzz', 'libharfbuzz_gobject_dep'])
+ harfbuzz_gobject_dep = dependency('harfbuzz-gobject', version: harfbuzz_req_version, required: false)
+
+ if not harfbuzz_gobject_dep.found() and cc.get_argument_syntax() == 'msvc'
+ # The CMake build files for HarfBuzz (which is used for MSVC builds) do not
+ # generate pkg-config files, so look for harfbuzz-gobject.lib
+ harfbuzz_gobject_dep = cc.find_library('harfbuzz-gobject', has_headers: ['hb-gobject.h'], required: false)
+ endif
+
+ if not harfbuzz_gobject_dep.found()
+ harfbuzz_gobject_dep = dependency('harfbuzz-gobject', version: harfbuzz_req_version, required: false,
+ fallback: ['harfbuzz', 'libharfbuzz_gobject_dep'])
+ endif
+
if harfbuzz_gobject_dep.found()
pango_deps += harfbuzz_gobject_dep
endif