summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2017-07-21 14:03:05 +0100
committerEmmanuele Bassi <ebassi@gnome.org>2017-07-21 14:04:49 +0100
commitbfd307855bd21108c98d72bf4d85a6c632396cde (patch)
tree7f2de6ee97a58ba04a42aa4f2f488c032733d6b7 /meson.build
parent8962736ba9deb8f6a6b143fce1b6fd692ffaaa21 (diff)
meson: Allow toggling internal/system PCRE dependency
We don't always want to build GLib with a dependency on the system's PCRE. The Autotools build allows this, and so should the Meson build.
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build12
1 files changed, 9 insertions, 3 deletions
diff --git a/meson.build b/meson.build
index eacdfff79..93641021e 100644
--- a/meson.build
+++ b/meson.build
@@ -1339,8 +1339,14 @@ else
error('No iconv() implementation found in C library or libiconv')
endif
-pcre = dependency('libpcre', required : false) # Should check for Unicode support, too. FIXME
-glib_conf.set('USE_SYSTEM_PCRE', pcre.found())
+if get_option('with-pcre') == 'internal'
+ pcre = []
+ use_system_pcre = false
+else
+ pcre = dependency('libpcre', required : false) # Should check for Unicode support, too. FIXME
+ use_system_pcre = pcre.found()
+endif
+glib_conf.set('USE_SYSTEM_PCRE', use_system_pcre)
libm = cc.find_library('m', required : false)
libffi_dep = dependency('libffi', version : '>= 3.0.0', fallback : ['libffi', 'ffi_dep'])
@@ -1401,7 +1407,7 @@ endif
if libiconv.length() != 0
glib_conf.set('ICONV_LIBS', '-liconv')
endif
-if pcre.found()
+if use_system_pcre
glib_conf.set('PCRE_LIBS', '-lpcre')
endif
if libmount_dep.length() == 1 and libmount_dep[0].found()