[gtksourceview: 2/3] meson: Add fallback for pcre2 and xml2




commit 8a31900a011d087f88d21884487226c7c4ff6e54
Author: Xavier Claessens <xavier claessens collabora com>
Date:   Mon Mar 8 19:45:20 2021 -0500

    meson: Add fallback for pcre2 and xml2
    
    When building on Windows those 2 dependencies are usually not available,
    but Meson can build them as subproject. Simply run 'meson wrap install
    pcre2' and 'meson wrap install libxml2'
    
    gtk4 and all its dependencies can also be built as subproject if adding
    a gtk4.wrap file. With those gtksourceview and all its deps can fully
    build on Windows with MSVC.

 meson.build | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)
---
diff --git a/meson.build b/meson.build
index 678c16a5..b655259b 100644
--- a/meson.build
+++ b/meson.build
@@ -84,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)
 
@@ -110,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('.')


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]