diff options
author | Iñigo Martínez <inigomartinez@gmail.com> | 2017-07-12 16:30:51 +0200 |
---|---|---|
committer | Michael Catanzaro <mcatanzaro@igalia.com> | 2017-10-17 16:32:41 -0500 |
commit | f7a71bd57254912547256045b747f9181eef3529 (patch) | |
tree | e7278e8dc0fdddc5b2e6acbd74e72c7626c5f497 /meson.build | |
parent | 8ff1b86cb8f6c848be82d99dbb593a50713ce6ad (diff) | |
download | dconf-f7a71bd57254912547256045b747f9181eef3529.tar.gz |
build: Port to meson build system
meson is a build system focused on speed an ease of use, which
helps speeding up the software development. This patch adds meson
support along autotools.
https://bugzilla.gnome.org/show_bug.cgi?id=784910
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 113 |
1 files changed, 113 insertions, 0 deletions
diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..5648257 --- /dev/null +++ b/meson.build @@ -0,0 +1,113 @@ +project( + 'dconf', ['c', 'vala'], + version: '0.26.0', + license: 'LGPL2.1+', + default_options: [ + 'buildtype=debugoptimized', + 'warning_level=1' + ], + meson_version: '>= 0.41.0' +) + +dconf_version = meson.project_version() +version_array = dconf_version.split('.') +dconf_major_version = version_array[0].to_int() +dconf_minor_version = version_array[1].to_int() +dconf_micro_version = version_array[2].to_int() + +dconf_prefix = get_option('prefix') +dconf_bindir = join_paths(dconf_prefix, get_option('bindir')) +dconf_datadir = join_paths(dconf_prefix, get_option('datadir')) +dconf_includedir = join_paths(dconf_prefix, get_option('includedir')) +dconf_libdir = join_paths(dconf_prefix, get_option('libdir')) +dconf_libexecdir = join_paths(dconf_prefix, get_option('libexecdir')) +dconf_mandir = join_paths(dconf_prefix, get_option('mandir')) + +dconf_namespace = 'ca.desrt.dconf' + +soversion = 1 +current = 0 +revision = 0 +libversion = '@0@.@1@.@2@'.format(soversion, current, revision) + +cc = meson.get_compiler('c') +valac = meson.get_compiler('vala') + +config_h = configuration_data() + +# package +set_defines = [ + ['PACKAGE', meson.project_name()], + ['PACKAGE_BUGREPORT', 'http://bugzilla.gnome.org/enter_bug.cgi?product=dconf'], + ['PACKAGE_NAME', meson.project_name()], + ['PACKAGE_STRING', '@0@ @1@'.format(meson.project_name(), dconf_version)], + ['PACKAGE_TARNAME', meson.project_name()], + ['PACKAGE_URL', 'https://wiki.gnome.org/Projects/dconf'], + ['PACKAGE_VERSION', dconf_version], + ['VERSION', dconf_version], + ['GETTEXT_PACKAGE', meson.project_name()] +] + +foreach define: set_defines + config_h.set_quoted(define[0], define[1]) +endforeach + +# compiler flags +common_flags = ['-DHAVE_CONFIG_H'] + +if get_option('buildtype').contains('debug') + test_cflags = [ + '-fno-common', + '-Wmissing-prototypes', + '-Wwrite-strings' + ] + + foreach cflag: test_cflags + if cc.has_argument(cflag) + common_flags += [cflag] + endif + endforeach +endif + +add_project_arguments(common_flags, language: 'c') + +gio_unix_req_version = '>= 2.25.7' + +glib_dep = dependency('glib-2.0', version: '>= 2.44.0') +gio_unix_dep = dependency('gio-unix-2.0', version: gio_unix_req_version) + +gio_querymodules = find_program('gio-querymodules', required: false) +if gio_querymodules.found() + gio_modules_dir = get_option('with-gio-modules-dir').strip() + if gio_modules_dir == '' + gio_modules_dir = join_paths(dconf_libdir, 'gio', 'modules') + endif + + meson.add_install_script('meson_post_install.py', gio_querymodules.path(), gio_modules_dir) +endif + +configure_file( + output: 'config.h', + configuration: config_h +) + +gnome = import('gnome') +pkg = import('pkgconfig') + +top_inc = include_directories('.') + +subdir('shm') +subdir('gvdb') +subdir('common') +subdir('engine') +subdir('service') +subdir('gdbus') +subdir('gsettings') +subdir('client') +subdir('bin') + +if get_option('enable-gtk-doc') + subdir('docs') +endif + +subdir('tests') |