summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitlab-ci.yml2
-rw-r--r--meson.build58
-rw-r--r--meson_options.txt5
-rw-r--r--pango/meson.build3
-rw-r--r--subprojects/freetype2.wrap16
-rw-r--r--tests/meson.build1
6 files changed, 50 insertions, 35 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 921f6ab2..0d1433cb 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -41,7 +41,7 @@ asan-build:
needs: []
variables:
script:
- - CC=clang meson --buildtype=debugoptimized -Db_sanitize=address -Db_lundef=false -Dintrospection=false _build
+ - CC=clang meson --buildtype=debugoptimized -Db_sanitize=address -Db_lundef=false -Dintrospection=disabled _build
- ninja -C _build
- .gitlab-ci/run-tests.sh _build
allow_failure: true
diff --git a/meson.build b/meson.build
index ed9dcc12..98f4e372 100644
--- a/meson.build
+++ b/meson.build
@@ -269,17 +269,15 @@ endif
pango_deps += harfbuzz_dep
-# Only use FontConfig fallback when required or requested
-
+# If option is 'auto' or 'enabled' it is not required to find fontconfig on the
+# system because a fallback is done at the end. Override 'disabled' option on
+# platforms that requires it.
fontconfig_option = get_option('fontconfig')
-
-fontconfig_sys_required = (host_system != 'windows' and host_system != 'darwin')
-if fontconfig_sys_required and fontconfig_option.disabled()
- error('Fontconfig is required on this platform (pass -Dfontconfig=enabled or -Dfontconfig=auto)')
+fontconfig_required = host_system not in ['windows', 'darwin']
+if not fontconfig_option.disabled() or fontconfig_required
+ fontconfig_option = false
endif
-fontconfig_required = fontconfig_sys_required or fontconfig_option.enabled()
-
fontconfig_dep = dependency('fontconfig', version: fontconfig_req_version, required: fontconfig_option)
if fontconfig_dep.found()
fontconfig_pc = 'fontconfig'
@@ -294,15 +292,19 @@ else
endif
endif
-if fontconfig_required and not fontconfig_dep.found()
+# Do the fallback now if fontconfig has not been found on the system. Override
+# user option on platforms that always require fontconfig.
+fontconfig_option = fontconfig_required ? true : get_option('fontconfig')
+if not fontconfig_dep.found()
fontconfig_dep = dependency('fontconfig', version: fontconfig_req_version,
- fallback: ['fontconfig', 'fontconfig_dep'])
+ fallback: ['fontconfig', 'fontconfig_dep'],
+ required: fontconfig_option)
endif
if fontconfig_dep.found()
pango_deps += fontconfig_dep
- if fontconfig_pc == 'fontconfig'
+ if fontconfig_dep.type_name() != 'library'
if fontconfig_dep.version().version_compare('>=2.12.92')
pango_conf.set('HAVE_FCWEIGHTFROMOPENTYPEDOUBLE', 1)
endif
@@ -318,9 +320,17 @@ else
endif
message('fontconfig has FcWeightFromOpenTypeDouble: ' + res)
+# If option is 'auto' or 'enabled' it is not required to find freetype2 on the
+# system because a fallback is done at the end. Override 'disabled' option on
+# if fontconfig has been found.
+freetype_option = get_option('freetype')
+freetype_required = fontconfig_dep.found()
+if not freetype_option.disabled() or freetype_required
+ freetype_option = false
+endif
+
# The first version of freetype with a pkg-config file is 2.1.5
-# We require both fontconfig and freetype if we are to have either.
-freetype_dep = dependency('freetype2', required: get_option('freetype'))
+freetype_dep = dependency('freetype2', required: freetype_option)
if freetype_dep.found()
freetype2_pc = 'freetype2'
@@ -328,7 +338,7 @@ else
if cc.get_id() == 'msvc' and cc.has_header('ft2build.h')
foreach ft2_lib: ['freetype', 'freetypemt']
if not freetype_dep.found()
- freetype_dep = cc.find_library(ft2_lib, required: get_option('freetype'))
+ freetype_dep = cc.find_library(ft2_lib, required: freetype_option)
if freetype_dep.found()
freetype2_lib = '-l@0@'.format(ft2_lib)
endif
@@ -337,8 +347,10 @@ else
endif
endif
-if fontconfig_required and not freetype_dep.found()
- freetype_dep = dependency('freetype2', required: get_option('freetype'),
+# Do the fallback now if freetype2 has not been found on the system.
+freetype_option = freetype_required ? true : get_option('freetype')
+if not freetype_dep.found()
+ freetype_dep = dependency('freetype2', required: freetype_option,
fallback: ['freetype2', 'freetype_dep'])
endif
@@ -371,14 +383,21 @@ if host_system == 'darwin'
pango_deps += dependency('appleframeworks', modules: [ 'CoreFoundation', 'ApplicationServices' ])
endif
+# If option is 'auto' or 'enabled' it is not required to find cairo on the
+# system because a fallback is done at the end.
+cairo_option = get_option('cairo')
+if not cairo_option.disabled()
+ cairo_option = false
+endif
+
cairo_found_type = ''
-cairo_dep = dependency('cairo', version: cairo_req_version, required: false)
+cairo_dep = dependency('cairo', version: cairo_req_version, required: cairo_option)
if cairo_dep.found()
cairo_found_type = cairo_dep.type_name()
else
if cc.get_id() == 'msvc' and cc.has_header('cairo.h')
- cairo_dep = cc.find_library('cairo', required: false)
+ cairo_dep = cc.find_library('cairo', required: cairo_option)
cairo_found_type = 'library'
endif
endif
@@ -387,7 +406,8 @@ endif
# in a declarative way
if not cairo_dep.found()
cairo_dep = dependency('cairo', version: cairo_req_version,
- fallback: ['cairo', 'libcairo_dep'], required: get_option('cairo'))
+ fallback: ['cairo', 'libcairo_dep'], required: get_option('cairo'),
+ default_options: ['freetype=enabled', 'fontconfig=enabled'])
cairo_found_type = cairo_dep.type_name()
endif
diff --git a/meson_options.txt b/meson_options.txt
index 5aa7c795..235b8a48 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -4,8 +4,9 @@ option('gtk_doc',
value: false)
option('introspection',
description: 'Build the GObject introspection data for Pango',
- type: 'boolean',
- value: true)
+ type: 'feature',
+ value: 'auto',
+ yield: true)
option('install-tests',
description : 'Install tests',
type: 'boolean',
diff --git a/pango/meson.build b/pango/meson.build
index 7fda16d7..91261274 100644
--- a/pango/meson.build
+++ b/pango/meson.build
@@ -121,7 +121,8 @@ libpango = library(
pango_dep_sources = [pango_enum_h]
-build_gir = get_option('introspection')
+gir = find_program('g-ir-scanner', required : get_option('introspection'))
+build_gir = gir.found() and (not meson.is_cross_build() or get_option('introspection').enabled())
if build_gir
gir_args = [
diff --git a/subprojects/freetype2.wrap b/subprojects/freetype2.wrap
index 21ed35ce..7c88f89c 100644
--- a/subprojects/freetype2.wrap
+++ b/subprojects/freetype2.wrap
@@ -1,12 +1,6 @@
-[wrap-file]
-directory = freetype-2.9.1
-
-source_url = https://download.savannah.gnu.org/releases/freetype/freetype-2.9.1.tar.gz
-source_filename = freetype-2.9.1.tar.gz
-source_hash = ec391504e55498adceb30baceebd147a6e963f636eb617424bcfc47a169898ce
-
-patch_url = https://wrapdb.mesonbuild.com/v1/projects/freetype2/2.9.1/1/get_zip
-patch_filename = freetype2-2.9.1-1-wrap.zip
-patch_hash = 06222607775e707c6d7b8d21ffdb04c7672f676a18c5ebb9880545130ab0407b
-
+[wrap-git]
+directory=freetype2
+url=https://github.com/centricular/freetype2.git
depth=1
+push-url=git@github.com:centricular/freetype2.git
+revision=meson
diff --git a/tests/meson.build b/tests/meson.build
index b962a758..ba96ac2c 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -95,7 +95,6 @@ test_breaks_data = [
'breaks/one',
'breaks/two',
'breaks/three',
- 'breaks/four',
]
if thai_dep.found()