Change log level to prevent abort.
[platform/upstream/at-spi2-core.git] / meson.build
1 project('at-spi2-core', 'c',
2         version: '2.44.1',
3         license: 'LGPLv2.1+',
4         default_options: [
5           'buildtype=debugoptimized',
6           'warning_level=1',
7           'c_std=c99',
8         ],
9         meson_version: '>= 0.46.0')
10
11 add_project_arguments([ '-D_POSIX_C_SOURCE=200809L', '-D_DEFAULT_SOURCE', '-fno-omit-frame-pointer' ], language: 'c')
12
13 atspi_gir_ns = 'Atspi'
14
15 cc = meson.get_compiler('c')
16 host_system = host_machine.system()
17
18 soversion = '0.0.1'
19
20 at_spi_conf = configuration_data()
21 at_spi_conf.set('GETTEXT_PACKAGE', meson.project_name())
22
23 root_inc = include_directories('.')
24 registryd_inc = include_directories('registryd')
25
26 atspi_prefix = get_option('prefix')
27 atspi_datadir = join_paths(atspi_prefix, get_option('datadir'))
28 atspi_libexecdir = join_paths(atspi_prefix, get_option('libexecdir'))
29 atspi_sysconfdir = join_paths(atspi_prefix, get_option('sysconfdir'))
30 atspi_libdir = join_paths(atspi_prefix, get_option('libdir'))
31 atspi_bindir = join_paths(atspi_prefix, get_option('bindir'))
32 atspi_includedir = join_paths(atspi_prefix, get_option('includedir'))
33
34 if get_option('dbus_services_dir') != 'default'
35   dbus_services_dir = get_option('dbus_services_dir')
36 else
37   dbus_services_dir = join_paths(get_option('datadir'), 'dbus-1/services')
38 endif
39
40 if get_option('systemd_user_dir') != 'default'
41   systemd_user_dir = get_option('systemd_user_dir')
42 else
43   systemd_user_dir = join_paths(get_option('prefix'), 'lib/systemd/user')
44 endif
45
46 # Dependencies
47 libdbus_req_version = '>= 1.5'
48 glib_req_version = '>= 2.62.0'
49 gobject_req_version = '>= 2.0.0'
50 gio_req_version = '>= 2.28.0'
51 gir_req_version = '>= 0.6.7'
52 app_svc_req_version = '>= 0.0.0'
53
54 libdbus_dep = dependency('dbus-1', version: libdbus_req_version)
55 glib_dep = dependency('glib-2.0', version: glib_req_version)
56 gobject_dep = dependency('gobject-2.0', version: gobject_req_version)
57 gio_dep = dependency('gio-2.0', version: gio_req_version)
58 app_svc_dep = dependency('appsvc', version: app_svc_req_version)
59 if cc.has_function('dlopen')
60   dl_dep = []
61 elif cc.has_function('dlopen', args: '-ldl')
62   dl_dep = cc.find_library('dl')
63 else
64   error('Could not find a library with the dlopen function')
65 endif
66
67 x11_deps = []
68 x11_option = get_option('x11')
69 # ensure x11_dep is defined for use elsewhere, such as bus/meson.build
70 x11_dep = dependency('', required: false)
71 if x11_option != 'no'
72   x11_dep = dependency('x11', required: false)
73
74   if x11_dep.found()
75     x11_deps += x11_dep
76     at_spi_conf.set('HAVE_X11', 1)
77     xtest_dep = dependency('xtst')
78     x11_deps += xtest_dep
79
80     if cc.has_function('XkbGetMap', dependencies: x11_deps)
81       at_spi_conf.set('HAVE_XKB', 1)
82     endif
83
84     xinput_dep = dependency('xi')
85     x11_deps += xinput_dep
86   endif
87 endif
88
89 # Alignments
90 at_spi_conf.set('ALIGNOF_CHAR', cc.alignment('char'))
91 at_spi_conf.set('ALIGNOF_DOUBLE', cc.alignment('double'))
92
93 dbus_alignments = [
94   'dbus_bool_t',
95   'dbus_int16_t',
96   'dbus_int32_t',
97   'dbus_int64_t',
98 ]
99
100 foreach a: dbus_alignments
101   at_spi_conf.set('ALIGNOF_' + a.underscorify().to_upper(),
102                   cc.alignment(a, prefix: '#include <dbus/dbus.h>', dependencies: libdbus_dep))
103 endforeach
104
105 at_spi_conf.set('ALIGNOF_DBIND_POINTER', cc.alignment('dbind_pointer', prefix: 'typedef void *dbind_pointer;'))
106 at_spi_conf.set('ALIGNOF_DBIND_STRUCT', cc.alignment('dbind_struct', prefix: 'typedef struct { char s1; } dbind_struct;'))
107
108 # introspection support
109 have_gir = false
110
111 introspection_option = get_option('introspection')
112 if introspection_option != 'no'
113   gir_dep = dependency('gobject-introspection-1.0', version: gir_req_version, required: false)
114
115   if gir_dep.found()
116     have_gir = true
117   endif
118 endif
119
120 xgettext = find_program('xgettext', required : false)
121
122 configure_file(output: 'config.h', configuration: at_spi_conf)
123
124 gnome = import('gnome')
125
126 subdir('dbind')
127 subdir('atspi')
128 subdir('bus')
129 subdir('registryd')
130 subdir('test')
131
132 if get_option('docs')
133   subdir('doc/libatspi')
134 endif
135
136 if xgettext.found()
137   subdir('po')
138 endif