b01400955ea8c456062e269aa1711ff36f760e01
[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   'atk.h',
38   'atkaction.h',
39   'atkcomponent.h',
40   'atkdocument.h',
41   'atkeditabletext.h',
42   'atkgobjectaccessible.h',
43   'atkhyperlink.h',
44   'atkhyperlinkimpl.h',
45   'atkhypertext.h',
46   'atknoopobject.h',
47   'atknoopobjectfactory.h',
48   'atkobject.h',
49   'atkobjectfactory.h',
50   'atkplug.h',
51   'atkimage.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   'atkmisc.h',
67   'atkvalue.h',
68   'atkwindow.h',
69 ]
70
71 install_headers(atk_headers, subdir: atk_api_path)
72
73 # Features header
74 atk_version_conf = configuration_data()
75 atk_version_conf.set('ATK_MAJOR_VERSION', atk_major_version)
76 atk_version_conf.set('ATK_MINOR_VERSION', atk_minor_version)
77 atk_version_conf.set('ATK_MICRO_VERSION', atk_micro_version)
78 atk_version_conf.set('ATK_BINARY_AGE', atk_binary_age)
79 atk_version_conf.set('ATK_INTERFACE_AGE', atk_interface_age)
80 atk_version_conf.set('LT_CURRENT_MINUS_AGE', '0')
81
82 atk_version_h = configure_file(input: 'atkversion.h.in',
83                output: 'atkversion.h',
84                configuration: atk_version_conf,
85                install: true,
86                install_dir: join_paths(atk_includedir, atk_api_path))
87
88 # Marshallers
89 atk_marshals = gnome.genmarshal('atkmarshal',
90                                 sources: 'atkmarshal.list',
91                                 prefix: 'atk_marshal')
92 atk_marshal_h = atk_marshals[1]
93
94 # Enumerations for GType
95 atk_enums = gnome.mkenums('atk-enum-types',
96                           sources: atk_headers,
97                           c_template: 'atk-enum-types.c.template',
98                           h_template: 'atk-enum-types.h.template',
99                           install_dir: join_paths(atk_includedir, atk_api_path),
100                           install_header: true)
101 atk_enum_h = atk_enums[1]
102
103 atk_cflags = [
104   '-DG_LOG_DOMAIN="Atk"',
105   '-DG_LOG_USE_STRUCTURED=1',
106   '-DGLIB_DISABLE_DEPRECATION_WARNINGS',
107   '-DATK_DISABLE_DEPRECATION_WARNINGS',
108   '-DATK_COMPILATION',
109   '-DATK_LOCALEDIR="@0@"'.format(join_paths(atk_datadir, 'locale')),
110 ]
111
112 if host_system == 'windows'
113   atk_win_rc = configure_file(
114     input: 'atk.rc.in',
115     output: 'atk.rc',
116     configuration: atk_version_conf,
117   )
118   atk_win_res = import('windows').compile_resources(atk_win_rc)
119   atk_sources += atk_win_res
120 endif
121
122 atk_inc = include_directories('.')
123
124 libatk = shared_library('atk-@0@'.format(atk_api_version),
125                         sources: atk_sources + atk_enums + atk_marshals,
126                         soversion: atk_soversion,
127                         version: atk_libversion,
128                         install: true,
129                         dependencies: gobject_dep,
130                         include_directories: [ root_inc, atk_inc ],
131                         c_args: common_cflags + atk_cflags,
132                         link_args: common_ldflags)
133
134 libatk_dep = declare_dependency(link_with: libatk,
135                                 include_directories: atk_inc,
136                                 dependencies: gobject_dep,
137                                 sources: atk_enum_h)
138
139 if not meson.is_cross_build()
140   gnome.generate_gir(libatk,
141                      sources: atk_sources + atk_headers + [ atk_enum_h ] + [ atk_version_h ],
142                      namespace: 'Atk',
143                      nsversion: atk_api_version,
144                      identifier_prefix: 'Atk',
145                      symbol_prefix: 'atk',
146                      export_packages: 'atk',
147                      includes: [ 'GObject-2.0' ],
148                      install: true,
149                      extra_args: [
150                        '--quiet',
151                        '--c-include=atk/atk.h',
152                        '-DATK_COMPILATION',
153                      ])
154 endif