diff options
author | Emmanuele Bassi <ebassi@gmail.com> | 2019-01-23 15:30:41 +0000 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gmail.com> | 2019-01-23 15:30:41 +0000 |
commit | 8f454cb427fb74096847713fa7ce7ff192c4bfff (patch) | |
tree | a790c0fdc9d821a7117741a150aa6c3c87934974 | |
parent | 816aa8dd3701feab54fffe223aa91257bc393548 (diff) | |
parent | 30f93b8e478841362132f65a46aeaba5591e617c (diff) | |
download | json-glib-8f454cb427fb74096847713fa7ce7ff192c4bfff.tar.gz |
Merge branch 'glib-fallback' into 'master'
Updates to Meson build system
See merge request GNOME/json-glib!13
-rw-r--r-- | doc/meson.build | 2 | ||||
-rw-r--r-- | json-glib/meson.build | 8 | ||||
-rw-r--r-- | meson.build | 18 | ||||
-rw-r--r-- | meson_options.txt | 6 | ||||
-rw-r--r-- | subprojects/glib.wrap | 5 |
5 files changed, 22 insertions, 17 deletions
diff --git a/doc/meson.build b/doc/meson.build index 901a698..43e110f 100644 --- a/doc/meson.build +++ b/doc/meson.build @@ -1,4 +1,4 @@ -if get_option('docs') +if find_program('gtkdoc-scan', required : get_option('gtk_doc')).found() subdir('xml') private_headers = [ diff --git a/json-glib/meson.build b/json-glib/meson.build index eb1c793..035e954 100644 --- a/json-glib/meson.build +++ b/json-glib/meson.build @@ -76,7 +76,7 @@ json_lib = library( version: libversion, soversion: soversion, include_directories: root_dir, - dependencies: [ gio_dep, gobject_dep, ], + dependencies: [gio_dep], c_args: json_c_args + common_cflags, link_args: common_ldflags, install: true, @@ -93,8 +93,8 @@ pkgg.generate( requires: 'gio-2.0', ) -build_gir = get_option('introspection') -if build_gir +gir = find_program('g-ir-scanner', required : get_option('introspection')) +if gir.found() gir_args = [ '--quiet', '--c-include=json-glib/json-glib.h', @@ -121,7 +121,7 @@ endif json_glib_dep = declare_dependency( link_with: json_lib, include_directories: root_dir, - dependencies: [ gobject_dep, gio_dep, ], + dependencies: [gio_dep], sources: [ json_enum_types_h, json_glib_gir ], ) diff --git a/meson.build b/meson.build index f585934..69c3896 100644 --- a/meson.build +++ b/meson.build @@ -5,7 +5,7 @@ project('json-glib', 'c', version: '1.5.1', 'buildtype=debugoptimized', 'c_std=c99', ], - meson_version: '>= 0.44.0') + meson_version: '>= 0.47.0') # Versioning json_version = meson.project_version() @@ -34,8 +34,8 @@ json_libexecdir = join_paths(get_option('prefix'), get_option('libexecdir')) # Dependencies glib_req_version = '>= 2.44.0' -gobject_dep = dependency('gobject-2.0', version: glib_req_version) -gio_dep = dependency('gio-2.0', version: glib_req_version) +gio_dep = dependency('gio-2.0', version: glib_req_version, + fallback: ['glib', 'libgio_dep']) # Configurations cc = meson.get_compiler('c') @@ -132,11 +132,11 @@ common_cflags = cc.get_supported_arguments(test_cflags) common_ldflags = [] if host_system == 'linux' - foreach ldflag: [ '-Wl,-Bsymbolic', '-Wl,-z,relro', '-Wl,-z,now', ] - if cc.has_argument(ldflag) - common_ldflags += ldflag - endif - endforeach + common_ldflags += cc.get_supported_link_arguments([ + '-Wl,-Bsymbolic', + '-Wl,-z,relro', + '-Wl,-z,now', + ]) endif # Maintain compatibility with autotools @@ -151,7 +151,7 @@ root_dir = include_directories('.') gnome = import('gnome') -python3 = import('python3').find_python() +python3 = import('python').find_installation() gen_installed_test = files('build-aux/gen-installed-test.py') subdir('json-glib') diff --git a/meson_options.txt b/meson_options.txt index 75152aa..a6b2a51 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,8 +1,8 @@ option('introspection', - type: 'boolean', value: true, + type: 'feature', value: 'auto', yield: true, description: 'Build the introspection data (requires gobject-introspection)') -option('docs', - type: 'boolean', value: false, +option('gtk_doc', + type: 'feature', value: 'auto', yield: true, description: 'Build the API reference (requires gtk-doc)') option('man', type: 'boolean', value: false, diff --git a/subprojects/glib.wrap b/subprojects/glib.wrap new file mode 100644 index 0000000..87021ae --- /dev/null +++ b/subprojects/glib.wrap @@ -0,0 +1,5 @@ +[wrap-git] +directory=glib +url=https://gitlab.gnome.org/GNOME/glib.git +push-url=git@gitlab.gnome.org:GNOME/glib.git +revision=master |