Merge pull request #3449 from fanc999/msvc-meson-use-cmake
Meson: Use CMake more to find dependencies on Windows
This commit is contained in:
commit
da801cdee1
3
BUILD.md
3
BUILD.md
@ -18,7 +18,8 @@ meson like above.
|
|||||||
|
|
||||||
On Windows, meson can build the project like above if a working MSVC's cl.exe (`vcvarsall.bat`)
|
On Windows, meson can build the project like above if a working MSVC's cl.exe (`vcvarsall.bat`)
|
||||||
or gcc/clang is already on your path, and if you use something like `meson build --wrap-mode=default`
|
or gcc/clang is already on your path, and if you use something like `meson build --wrap-mode=default`
|
||||||
it fetches and compiles most of the dependencies also.
|
it fetches and compiles most of the dependencies also. It is recommended to install CMake either
|
||||||
|
manually or via the Visual Studio installer when building with MSVC when building with meson.
|
||||||
|
|
||||||
Our CI configurations is also a good source of learning how to build HarfBuzz.
|
Our CI configurations is also a good source of learning how to build HarfBuzz.
|
||||||
|
|
||||||
|
51
meson.build
51
meson.build
@ -83,50 +83,25 @@ check_funcs = [
|
|||||||
|
|
||||||
m_dep = cpp.find_library('m', required: false)
|
m_dep = cpp.find_library('m', required: false)
|
||||||
|
|
||||||
freetype_dep = null_dep
|
# https://github.com/harfbuzz/harfbuzz/pull/2498
|
||||||
if not get_option('freetype').disabled()
|
freetype_dep = dependency(cpp.get_argument_syntax() == 'msvc' ? 'freetype' : 'freetype2',
|
||||||
freetype_dep = dependency('freetype2', required: false)
|
required: get_option('freetype'),
|
||||||
|
default_options: ['harfbuzz=disabled'])
|
||||||
if (not freetype_dep.found() and
|
|
||||||
cpp.get_id() == 'msvc' and
|
|
||||||
cpp.has_header('ft2build.h'))
|
|
||||||
freetype_dep = cpp.find_library('freetype', required: false)
|
|
||||||
endif
|
|
||||||
|
|
||||||
if not freetype_dep.found()
|
|
||||||
# https://github.com/harfbuzz/harfbuzz/pull/2498
|
|
||||||
freetype_dep = dependency('freetype2', required: get_option('freetype'),
|
|
||||||
default_options: ['harfbuzz=disabled'])
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
glib_dep = dependency('glib-2.0', required: get_option('glib'))
|
glib_dep = dependency('glib-2.0', required: get_option('glib'))
|
||||||
gobject_dep = dependency('gobject-2.0', required: get_option('gobject'))
|
gobject_dep = dependency('gobject-2.0', required: get_option('gobject'))
|
||||||
graphite2_dep = dependency('graphite2', required: get_option('graphite2'))
|
graphite2_dep = dependency('graphite2', required: get_option('graphite2'))
|
||||||
graphite_dep = dependency('graphite2', required: get_option('graphite'))
|
graphite_dep = dependency('graphite2', required: get_option('graphite'))
|
||||||
|
|
||||||
icu_dep = null_dep
|
if cpp.get_argument_syntax() == 'msvc'
|
||||||
if not get_option('icu').disabled()
|
icu_dep = dependency('ICU',
|
||||||
icu_dep = dependency('icu-uc', required: false)
|
required: get_option('icu'),
|
||||||
|
components: 'uc',
|
||||||
if (not icu_dep.found() and
|
method: 'cmake')
|
||||||
cpp.get_id() == 'msvc' and
|
else
|
||||||
cpp.has_header('unicode/uchar.h') and
|
icu_dep = dependency('icu-uc',
|
||||||
cpp.has_header('unicode/unorm2.h') and
|
required: get_option('icu'),
|
||||||
cpp.has_header('unicode/ustring.h') and
|
method: 'pkg-config')
|
||||||
cpp.has_header('unicode/utf16.h') and
|
|
||||||
cpp.has_header('unicode/uversion.h') and
|
|
||||||
cpp.has_header('unicode/uscript.h'))
|
|
||||||
if get_option('buildtype') == 'debug'
|
|
||||||
icu_dep = cpp.find_library('icuucd', required: false)
|
|
||||||
else
|
|
||||||
icu_dep = cpp.find_library('icuuc', required: false)
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
if not icu_dep.found()
|
|
||||||
icu_dep = dependency('icu-uc', required: get_option('icu'))
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if icu_dep.found() and icu_dep.type_name() == 'pkgconfig'
|
if icu_dep.found() and icu_dep.type_name() == 'pkgconfig'
|
||||||
|
@ -5,3 +5,4 @@ revision=VER-2-11-0
|
|||||||
|
|
||||||
[provide]
|
[provide]
|
||||||
freetype2 = freetype_dep
|
freetype2 = freetype_dep
|
||||||
|
freetype = freetype_dep
|
||||||
|
Loading…
x
Reference in New Issue
Block a user