service: Port from g_type_class_add_private() to G_ADD_PRIVATE()
[dconf.git] / meson.build
blobcddf083bbebd393d1bffed2b80f22b0adca9bc05
1 project(
2   'dconf', ['c', 'vala'],
3   version: '0.28.0',
4   license: 'LGPL2.1+',
5   default_options: [
6     'buildtype=debugoptimized',
7     'warning_level=1'
8   ],
9   meson_version: '>= 0.41.0'
12 dconf_version = meson.project_version()
13 version_array = dconf_version.split('.')
14 dconf_major_version = version_array[0].to_int()
15 dconf_minor_version = version_array[1].to_int()
16 dconf_micro_version = version_array[2].to_int()
18 dconf_prefix = get_option('prefix')
19 dconf_bindir = join_paths(dconf_prefix, get_option('bindir'))
20 dconf_datadir = join_paths(dconf_prefix, get_option('datadir'))
21 dconf_includedir = join_paths(dconf_prefix, get_option('includedir'))
22 dconf_libdir = join_paths(dconf_prefix, get_option('libdir'))
23 dconf_libexecdir = join_paths(dconf_prefix, get_option('libexecdir'))
24 dconf_mandir = join_paths(dconf_prefix, get_option('mandir'))
26 dconf_namespace = 'ca.desrt.dconf'
28 soversion = 1
29 current = 0
30 revision = 0
31 libversion = '@0@.@1@.@2@'.format(soversion, current, revision)
33 cc = meson.get_compiler('c')
34 valac = meson.get_compiler('vala')
36 config_h = configuration_data()
38 # package
39 set_defines = [
40   ['PACKAGE', meson.project_name()],
41   ['PACKAGE_BUGREPORT', 'http://bugzilla.gnome.org/enter_bug.cgi?product=dconf'],
42   ['PACKAGE_NAME', meson.project_name()],
43   ['PACKAGE_STRING', '@0@ @1@'.format(meson.project_name(), dconf_version)],
44   ['PACKAGE_TARNAME', meson.project_name()],
45   ['PACKAGE_URL', 'https://wiki.gnome.org/Projects/dconf'],
46   ['PACKAGE_VERSION', dconf_version],
47   ['VERSION', dconf_version],
48   ['GETTEXT_PACKAGE', meson.project_name()]
51 foreach define: set_defines
52   config_h.set_quoted(define[0], define[1])
53 endforeach
55 # compiler flags
56 common_flags = ['-DHAVE_CONFIG_H']
58 if get_option('buildtype').contains('debug')
59   test_cflags = [
60     '-fno-common',
61     '-Wmissing-prototypes',
62     '-Wwrite-strings'
63   ]
65   foreach cflag: test_cflags
66     if cc.has_argument(cflag)
67       common_flags += [cflag]
68     endif
69   endforeach
70 endif
72 add_project_arguments(common_flags, language: 'c')
74 gio_unix_req_version = '>= 2.25.7'
76 glib_dep = dependency('glib-2.0', version: '>= 2.44.0')
77 gio_unix_dep = dependency('gio-unix-2.0', version: gio_unix_req_version)
79 gio_querymodules = find_program('gio-querymodules', required: false)
80 if gio_querymodules.found()
81   gio_modules_dir = get_option('with-gio-modules-dir').strip()
82   if gio_modules_dir == ''
83     gio_modules_dir = join_paths(dconf_libdir, 'gio', 'modules')
84   endif
86   meson.add_install_script('meson_post_install.py', gio_querymodules.path(), gio_modules_dir)
87 endif
89 configure_file(
90   output: 'config.h',
91   configuration: config_h
94 gnome = import('gnome')
95 pkg = import('pkgconfig')
97 top_inc = include_directories('.')
99 subdir('shm')
100 subdir('gvdb')
101 subdir('common')
102 subdir('engine')
103 subdir('service')
104 subdir('gdbus')
105 subdir('gsettings')
106 subdir('client')
107 subdir('bin')
109 if get_option('enable-gtk-doc')
110   subdir('docs')
111 endif
113 subdir('tests')