summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Hergert <christian@hergert.me>2021-03-09 02:50:10 +0000
committerChristian Hergert <christian@hergert.me>2021-03-09 02:50:10 +0000
commitfda2f918f73801e7eba8d58e536fb47bead8ef18 (patch)
treee228e5f421448c67f50a56dcd22824b8f6433aac
parent69c8c6bd88e152fa50f514569ec487ca9f61383c (diff)
parent8a31900a011d087f88d21884487226c7c4ff6e54 (diff)
downloadgtksourceview-fda2f918f73801e7eba8d58e536fb47bead8ef18.tar.gz
Merge branch 'meson-fallbacks' into 'master'
Add dependency fallbacks See merge request GNOME/gtksourceview!179
-rw-r--r--.gitlab-ci.yml2
-rw-r--r--README.win321
-rw-r--r--meson.build18
-rw-r--r--meson_options.txt4
4 files changed, 9 insertions, 16 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index e0c8164e..d1cbc0cb 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -31,7 +31,7 @@ reference:
- dnf update -y --nogpgcheck
- dnf install -y --nogpgcheck $FEDORA_DEPS
- mkdir -p pfx/
- - meson ${MESON_FLAGS} --prefix=${PWD}/pfx -Dgtk_doc=true -Dgir=false _build
+ - meson ${MESON_FLAGS} --prefix=${PWD}/pfx -Dgtk_doc=true _build
- ninja -C _build install
- mkdir -p _reference/
- mv pfx/share/gtk-doc/html/gtksourceview-5.0 _reference/
diff --git a/README.win32 b/README.win32
index 891671ef..7e327fcc 100644
--- a/README.win32
+++ b/README.win32
@@ -48,7 +48,6 @@ To build GtkSourceView, do the following:
--backend=vs: Generate Visual Studio projects for building on Visual Studio 2010, 2015
2017, 2019. This will remove the need for Ninja. Please note that the
generated project files are only valid on the machine they are generated.
- -Dgir=false: Disable introspection builds.
-If the previous command completed successfully, carry out the build by running 'ninja' or
by opening and building the projects with the generated Visual Studio projects, if using
diff --git a/meson.build b/meson.build
index 72308550..b655259b 100644
--- a/meson.build
+++ b/meson.build
@@ -59,7 +59,8 @@ testdatadir = join_paths(datadir, 'installed-tests', package_string)
docpath = join_paths(datadir, 'gtk-doc', 'html', package_string)
# Options
-generate_gir = get_option('gir')
+gir = find_program('g-ir-scanner', required : get_option('introspection'))
+generate_gir = gir.found() and (not meson.is_cross_build() or get_option('introspection').enabled())
generate_vapi = generate_gir and get_option('vapi')
build_gtk_doc = get_option('gtk_doc')
@@ -83,11 +84,13 @@ glib_dep = dependency('glib-2.0', version: glib_req)
gobject_dep = dependency('gobject-2.0', version: glib_req)
gio_dep = dependency('gio-2.0', version: glib_req)
gtk_dep = dependency('gtk4', version: gtk_req)
-libxml_dep = dependency('libxml-2.0', version: libxml_req, required: cc.get_id() != 'msvc')
+libxml_dep = dependency('libxml-2.0', version: libxml_req,
+ fallback : ['libxml2', 'xml2lib_dep'])
fribidi_dep = dependency('fribidi', version: fribidi_req)
fontconfig_dep = dependency('fontconfig', required: false)
pangoft2_dep = dependency('pangoft2', required: false)
-pcre2_dep = dependency('libpcre2-8', version: pcre2_req)
+pcre2_dep = dependency('libpcre2-8', version: pcre2_req,
+ fallback : ['pcre2', 'libpcre2_8'])
gtk_quartz_dep = dependency('gtk4-quartz', version: gtk_doc_req, required: false)
@@ -109,15 +112,6 @@ else
gtk_doc_dep = []
endif
-# Look for the libxml2 library manually on Visual Studio if
-# its pkg-config file could not be found, as the NMake
-# Makefiles of libxml2 do not generate the pkg-config files
-# for us. Remove once Meson gains the ability to declare
-# deps in a declarative way
-if cc.get_id() == 'msvc' and not libxml_dep.found()
- libxml_dep = cc.find_library('libxml2', has_headers: ['libxml/xmlreader.h', 'libxml/parser.h'])
-endif
-
xmllint_prg = find_program('xmllint', required: false)
glib_version_arr = glib_req_version.split('.')
diff --git a/meson_options.txt b/meson_options.txt
index 443f0476..292a41a9 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -2,8 +2,8 @@ option('install_tests',
type: 'boolean', value: false,
description: 'Install test programs')
-option('gir',
- type: 'boolean', value: true,
+option('introspection',
+ type: 'feature', value: 'auto',
description: 'Generate gir data (requires gobject-introspection)')
option('vapi',