[libsoup] meson: Be able to build the static library



commit db8b4a90b21452fdf6519dad2211ce81c954b7c2
Author: Tomas Popela <tpopela redhat com>
Date:   Mon Dec 17 12:57:24 2018 +0100

    meson: Be able to build the static library
    
    Don't use the meson's shared_library() target, but the library() one, so
    we are able to change the library type through the default_library
    option.
    
    Also disable introspection if the static library is requested as the
    gnome.generate_gir() needs an executable or a shared library.

 libsoup/meson.build | 4 ++--
 meson.build         | 8 ++++++--
 2 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/libsoup/meson.build b/libsoup/meson.build
index 2b149a0e..eaa74d12 100644
--- a/libsoup/meson.build
+++ b/libsoup/meson.build
@@ -223,7 +223,7 @@ deps = [
   platform_deps
 ]
 
-libsoup = shared_library('soup-@0@'.format(apiversion),
+libsoup = library('soup-@0@'.format(apiversion),
   soup_sources,
   soup_headers,
   soup_enums,
@@ -262,7 +262,7 @@ if enable_gnome
     soup_gnome_installed_headers,
     subdir : includedir)
 
-  libsoup_gnome = shared_library(soup_gnome_api_name,
+  libsoup_gnome = library(soup_gnome_api_name,
     soup_gnome_sources + soup_gnome_headers,
     version : libversion,
     soversion : soversion,
diff --git a/meson.build b/meson.build
index 4135a518..c8347e1f 100644
--- a/meson.build
+++ b/meson.build
@@ -85,7 +85,8 @@ cdata = configuration_data()
 
 platform_deps = []
 hidden_visibility_flag = []
-if get_option('default_library') != 'static'
+is_static_library = get_option('default_library') == 'static'
+if not is_static_library
   if host_machine.system() == 'windows'
     platform_deps = [cc.find_library('ws2_32')]
     cdata.set('DLL_EXPORT', true)
@@ -263,7 +264,10 @@ enable_gnome = get_option('gnome') and host_machine.system() != 'windows'
 #########################
 # GObject introspection #
 #########################
-enable_introspection = get_option('introspection') and find_program('g-ir-scanner', required: false).found() 
and not meson.is_cross_build()
+# FIXME: once we start to require meson 0.49.0+ and gnome-introspection 1.58.1+
+# the we can enable the introspection even for the static build. See
+# https://github.com/mesonbuild/meson/pull/4478.
+enable_introspection = get_option('introspection') and find_program('g-ir-scanner', required: false).found() 
and not meson.is_cross_build() and not is_static_library
 
 ############
 # Vala API #


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