[libsoup/wip/meson: 76/93] meson: Add fallback discovery for libxml2 and sqlite3 on MSVC
- From: Tomas Popela <tpopela src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libsoup/wip/meson: 76/93] meson: Add fallback discovery for libxml2 and sqlite3 on MSVC
- Date: Wed, 11 Apr 2018 10:45:41 +0000 (UTC)
commit cecb5de96bcd0364b23591bb850c89c19cc870fe
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Tue Nov 28 17:28:20 2017 +0800
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.
meson.build | 22 ++++++++++++++++++++--
1 files changed, 20 insertions(+), 2 deletions(-)
---
diff --git a/meson.build b/meson.build
index e667efa..238876e 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()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]