summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorChun-wei Fan <fanchunwei@src.gnome.org>2017-11-28 17:28:20 +0800
committerTomas Popela <tpopela@redhat.com>2018-04-11 12:39:19 +0200
commitcecb5de96bcd0364b23591bb850c89c19cc870fe (patch)
treea1a1da5fb0779cdbf310e0044612a43f89aa10b7 /meson.build
parent11094baf76b65344decd8369850b68bfc7dc5b90 (diff)
downloadlibsoup-cecb5de96bcd0364b23591bb850c89c19cc870fe.tar.gz
meson: Add fallback discovery for libxml2 and sqlite3 on MSVC
The build system for Visual Studio for libxml2, as well as the typical amalgamation sources for sqlite3 that is used for Visual Studio builds do not generate pkg-config files. So, on Visual Studio builds, we need to manually look for these dependencies when their pkg-config files cannot be found. This is done because hand-crafting pkg-config files is a tedious process that can be error-prone.
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build22
1 files changed, 20 insertions, 2 deletions
diff --git a/meson.build b/meson.build
index e667efa7..238876e3 100644
--- a/meson.build
+++ b/meson.build
@@ -28,9 +28,27 @@ glib_dep = [dependency('glib-2.0', version : '>=2.38'),
dependency('gobject-2.0', version : '>=2.38'),
dependency('gio-2.0', version : '>=2.38')]
-sqlite_dep = [dependency('sqlite3')]
+sqlite_dep = dependency('sqlite3', required: cc.get_id() != 'msvc')
+
+# Fallback check for sqlite on Visual Studio, which normally does not
+# generate a pkg-config file upon a successful build
+if not sqlite_dep.found()
+ cc.has_header('sqlite3.h')
+ cc.has_header('sqlite3ext.h')
+ sqlite_dep = cc.find_library('sqlite3')
+endif
+
+libxml_dep = dependency('libxml-2.0', required: cc.get_id() != 'msvc')
-libxml_dep = [dependency('libxml-2.0')]
+
+# Fallback check for libxml2 on Visual Studio, which normally does not
+# generate a pkg-config file upon a successful build
+if not libxml_dep.found()
+ # Note: The XML include dir needs to be within the INCLUDE envvar,
+ # such as <INCLUDEDIR>\libxml2
+ cc.has_header('libxml/tree.h')
+ libxml2_dep = cc.find_library('libxml2')
+endif
cdata = configuration_data()