Protect against NULL pointer dereference
[platform/upstream/atk.git] / atk / meson.build
1 atk_sources = [
2   'atkaction.c',
3   'atkcomponent.c',
4   'atkdocument.c',
5   'atkeditabletext.c',
6   'atkgobjectaccessible.c',
7   'atkhyperlink.c',
8   'atkhyperlinkimpl.c',
9   'atkhypertext.c',
10   'atkimage.c',
11   'atknoopobject.c',
12   'atknoopobjectfactory.c',
13   'atkobject.c',
14   'atkobjectfactory.c',
15   'atkplug.c',
16   'atkprivate.c',
17   'atkrange.c',
18   'atkregistry.c',
19   'atkrelation.c',
20   'atkrelationset.c',
21   'atkselection.c',
22   'atksocket.c',
23   'atkstate.c',
24   'atkstateset.c',
25   'atkstreamablecontent.c',
26   'atktable.c',
27   'atktablecell.c',
28   'atktext.c',
29   'atkutil.c',
30   'atkmisc.c',
31   'atkvalue.c',
32   'atkversion.c',
33   'atkwindow.c',
34 ]
35
36 atk_headers = [
37   'atkaction.h',
38   'atkcomponent.h',
39   'atkdocument.h',
40   'atkeditabletext.h',
41   'atkgobjectaccessible.h',
42   'atkhyperlink.h',
43   'atkhyperlinkimpl.h',
44   'atkhypertext.h',
45   'atkimage.h',
46   'atkmisc.h',
47   'atknoopobject.h',
48   'atknoopobjectfactory.h',
49   'atkobject.h',
50   'atkobjectfactory.h',
51   'atkplug.h',
52   'atkrange.h',
53   'atkregistry.h',
54   'atkrelation.h',
55   'atkrelationtype.h',
56   'atkrelationset.h',
57   'atkselection.h',
58   'atksocket.h',
59   'atkstate.h',
60   'atkstateset.h',
61   'atkstreamablecontent.h',
62   'atktable.h',
63   'atktablecell.h',
64   'atktext.h',
65   'atkutil.h',
66   'atkvalue.h',
67   'atkwindow.h',
68 ]
69
70 install_headers(atk_headers + ['atk.h'], subdir: atk_api_path)
71
72 # Features header
73 atk_version_conf = configuration_data()
74 atk_version_conf.set('ATK_MAJOR_VERSION', atk_major_version)
75 atk_version_conf.set('ATK_MINOR_VERSION', atk_minor_version)
76 atk_version_conf.set('ATK_MICRO_VERSION', atk_micro_version)
77 atk_version_conf.set('ATK_BINARY_AGE', atk_binary_age)
78 atk_version_conf.set('ATK_INTERFACE_AGE', atk_interface_age)
79 atk_version_conf.set('LT_CURRENT_MINUS_AGE', '0')
80 atk_version_conf.set('ATK_VERSION', meson.project_version())
81
82 atk_version_h = configure_file(input: 'atkversion.h.in',
83   output: 'atkversion.h',
84   configuration: atk_version_conf,
85   install_dir: join_paths(atk_includedir, atk_api_path),
86 )
87
88 # Marshallers
89 atk_marshals = gnome.genmarshal('atkmarshal',
90   sources: 'atkmarshal.list',
91   prefix: 'atk_marshal',
92 )
93 atk_marshal_h = atk_marshals[1]
94
95 # Enumerations for GType
96 atk_enums = gnome.mkenums('atk-enum-types',
97   sources: atk_headers,
98   c_template: 'atk-enum-types.c.template',
99   h_template: 'atk-enum-types.h.template',
100   install_dir: join_paths(atk_includedir, atk_api_path),
101   install_header: true,
102 )
103 atk_enum_h = atk_enums[1]
104
105 atk_cflags = [
106   '-DG_LOG_DOMAIN="Atk"',
107   '-DG_LOG_USE_STRUCTURED=1',
108   '-DGLIB_DISABLE_DEPRECATION_WARNINGS',
109   '-DATK_DISABLE_DEPRECATION_WARNINGS',
110   '-DATK_COMPILATION',
111   '-DATK_LOCALEDIR="@0@"'.format(join_paths(atk_datadir, 'locale')),
112 ]
113
114 if host_system == 'windows'
115   atk_win_rc = configure_file(
116     input: 'atk.rc.in',
117     output: 'atk.rc',
118     configuration: atk_version_conf,
119   )
120   atk_win_res = import('windows').compile_resources(atk_win_rc)
121   atk_sources += atk_win_res
122 endif
123
124 libatk = library(atk_api_name,
125   sources: atk_sources + atk_enums + atk_marshals,
126   soversion: atk_soversion,
127   version: atk_libversion,
128   install: true,
129   dependencies: glib_dep,
130   include_directories: [ root_inc, atk_inc ],
131   c_args: common_cflags + atk_cflags,
132   link_args: common_ldflags,
133 )
134
135 atk_sources_dep = [ atk_enum_h ]
136
137 if get_option('introspection')
138   atk_sources_dep += gnome.generate_gir(libatk,
139     sources: atk_sources + atk_headers + [ atk_enum_h ] + [ atk_version_h ],
140     namespace: 'Atk',
141     nsversion: atk_api_version,
142     identifier_prefix: 'Atk',
143     symbol_prefix: 'atk',
144     export_packages: 'atk',
145     includes: [ 'GObject-2.0' ],
146     install: true,
147     extra_args: [
148       '--quiet',
149       '--c-include=atk/atk.h',
150       '-DATK_COMPILATION',
151     ],
152   )
153 endif
154
155 libatk_dep = declare_dependency(link_with: libatk,
156   include_directories: [ root_inc, atk_inc ],
157   dependencies: glib_dep,
158   sources: atk_sources_dep,
159 )
160
161 pkgconfig.generate(libatk,
162   name: 'Atk',
163   description: 'Accessibility Toolkit',
164   subdirs: atk_api_name,
165   filebase: 'atk',
166   requires: glib_dep,
167 )