1 project('libmpdclient', 'c', version: '2.13',
8 cc = meson.get_compiler('c')
10 conf = configuration_data()
11 conf.set_quoted('PACKAGE', meson.project_name())
12 conf.set_quoted('VERSION', meson.project_version())
14 if host_machine.system() != 'windows'
15 conf.set_quoted('DEFAULT_SOCKET', get_option('default_socket'))
18 conf.set_quoted('DEFAULT_HOST', get_option('default_host'))
19 conf.set('DEFAULT_PORT', get_option('default_port'))
22 conf.set('ENABLE_TCP', '1')
24 if cc.has_function('getaddrinfo')
25 conf.set('HAVE_GETADDRINFO', '1')
29 configure_file(output: 'config.h', configuration: conf)
31 version_conf = configuration_data()
32 splitted_version = meson.project_version().split('.')
33 version_conf.set('MAJOR_VERSION', splitted_version[0])
34 version_conf.set('MINOR_VERSION', splitted_version[1])
35 if splitted_version.length() >= 3
36 version_conf.set('PATCH_VERSION', splitted_version[2])
38 version_conf.set('PATCH_VERSION', '0')
40 configure_file(input: 'include/mpd/version.h.in', output: 'version.h', configuration: version_conf)
43 # for strdup() with glibc
50 '-Wno-deprecated-declarations',
51 '-Wmissing-prototypes',
54 '-Wstrict-prototypes',
59 foreach f: test_cflags
61 common_cflags += [ f ]
65 add_global_arguments(common_cflags, language: 'c')
72 if host_machine.system() == 'linux'
73 test_ldflags += [ '-Wl,--version-script=' + join_paths(meson.source_root(), 'libmpdclient.ld') ]
76 foreach f: test_ldflags
78 common_ldflags += [ f ]
83 if host_machine.system() == 'windows'
84 platform_deps = [cc.find_library('ws2_32')]
87 inc = include_directories(
91 # for the generated config.h
95 libmpdclient = library('mpdclient',
142 include_directories: inc,
146 link_args: common_ldflags,
147 version: meson.project_version(),
148 soversion: splitted_version[0],
151 libmpdclient_dep = declare_dependency(link_with: libmpdclient)
153 executable('example',
155 include_directories: inc,
161 'include/mpd/async.h',
162 'include/mpd/audio_format.h',
163 'include/mpd/client.h',
164 'include/mpd/capabilities.h',
165 'include/mpd/compiler.h',
166 'include/mpd/connection.h',
167 'include/mpd/database.h',
168 'include/mpd/directory.h',
169 'include/mpd/entity.h',
170 'include/mpd/error.h',
171 'include/mpd/idle.h',
172 'include/mpd/list.h',
173 'include/mpd/mixer.h',
174 'include/mpd/parser.h',
175 'include/mpd/password.h',
176 'include/mpd/player.h',
177 'include/mpd/playlist.h',
178 'include/mpd/protocol.h',
179 'include/mpd/queue.h',
180 'include/mpd/recv.h',
181 'include/mpd/response.h',
182 'include/mpd/send.h',
183 'include/mpd/status.h',
184 'include/mpd/stats.h',
186 'include/mpd/output.h',
187 'include/mpd/pair.h',
188 'include/mpd/search.h',
189 'include/mpd/socket.h',
190 'include/mpd/song.h',
191 'include/mpd/sticker.h',
192 'include/mpd/settings.h',
193 'include/mpd/message.h',
194 join_paths(meson.build_root(), 'version.h'),
197 docdir = join_paths(get_option('datadir'), 'doc', meson.project_name())
198 install_data('AUTHORS', 'COPYING', 'NEWS', 'README.rst',
201 install_data('vapi/libmpdclient.vapi',
202 install_dir : join_paths(get_option('datadir'), 'vala', 'vapi'))
204 pkg_mod = import('pkgconfig')
206 libraries: libmpdclient,
207 version: meson.project_version(),
208 name: 'libmpdclient',
209 description: 'Music Player Daemon client library',
212 if get_option('documentation')
213 doxygen = find_program('doxygen', required: false)
219 if get_option('test')
220 check_dep = dependency('check')