Commit 19ff587e authored by Adrien Plazas's avatar Adrien Plazas Committed by Guido Gunther

meson: Allow to build as a static library

This also disables the Glade catalog and it doesn't work with a static
libhandy.
parent c1924cf8
......@@ -118,12 +118,20 @@ else
vapidir = join_paths(get_option('datadir'), 'vala', 'vapi')
endif
static = get_option('static')
glade_catalog_feature = get_option('glade_catalog')
if static and glade_catalog_feature.enabled()
error('The Glade Catalog isn’t available for static libhandy.')
endif
gladeui_dep = dependency('gladeui-2.0', required : glade_catalog_feature)
glade_catalog = gladeui_dep.found()
glade_catalog = gladeui_dep.found() and not static
introspection_feature = get_option('introspection')
introspection = introspection_feature.enabled() or introspection_feature.auto()
if static and introspection_feature.enabled()
error('Introspection isn’t available for static libhandy.')
endif
introspection = introspection_feature.enabled() or (introspection_feature.auto() and not static)
gnome = import('gnome')
......@@ -150,6 +158,7 @@ summary = [
' Tests: @0@'.format(get_option('tests')),
' Examples: @0@'.format(get_option('examples')),
' Documentation: @0@'.format(get_option('gtk_doc')),
' Static: @0@'.format(static),
' Introspection: @0@'.format(introspection),
' Vapi: @0@'.format(get_option('vapi')),
' Glade Catalog: @0@'.format(glade_catalog),
......
# Performance and debugging related options
option('profiling', type: 'boolean', value: false)
option('static', type: 'boolean', value: false,
description: 'Build as a static library'
)
option('introspection', type: 'feature', value: 'auto')
option('vapi', type: 'boolean', value: true)
......
......@@ -136,7 +136,14 @@ if cc.links('int main() { return 0; }', args : ld_version_script_arg, name : 'ld
libhandy_link_args += [ld_version_script_arg]
endif
libhandy = shared_library(
static = get_option('static')
if static
libtype = 'static_library'
else
libtype = 'shared_library'
endif
libhandy = build_target(
'handy-' + apiversion,
libhandy_sources,
......@@ -147,6 +154,7 @@ libhandy = shared_library(
install: true,
link_args: libhandy_link_args,
install_dir: libdir,
target_type: libtype,
)
libhandy_dep = declare_dependency(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment