1 project('libmpdclient', 'c', version: '2.14',
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', true)
23 conf.set('HAVE_GETADDRINFO', cc.has_function('getaddrinfo'))
26 configure_file(output: 'config.h', configuration: conf)
28 version_conf = configuration_data()
29 splitted_version = meson.project_version().split('.')
30 version_conf.set('MAJOR_VERSION', splitted_version[0])
31 version_conf.set('MINOR_VERSION', splitted_version[1])
32 if splitted_version.length() >= 3
33 version_conf.set('PATCH_VERSION', splitted_version[2])
35 version_conf.set('PATCH_VERSION', '0')
37 configure_file(input: 'include/mpd/version.h.in', output: 'version.h', configuration: version_conf)
40 # for strdup() with glibc
47 '-Wno-deprecated-declarations',
48 '-Wmissing-prototypes',
51 '-Wstrict-prototypes',
56 foreach f: test_cflags
58 common_cflags += [ f ]
62 add_global_arguments(common_cflags, language: 'c')
69 if host_machine.system() == 'linux'
70 test_ldflags += [ '-Wl,--version-script=' + join_paths(meson.source_root(), 'libmpdclient.ld') ]
73 foreach f: test_ldflags
75 common_ldflags += [ f ]
80 if host_machine.system() == 'windows'
81 platform_deps = [cc.find_library('ws2_32')]
84 inc = include_directories(
88 # for the generated config.h
92 libmpdclient = library('mpdclient',
139 include_directories: inc,
143 link_args: common_ldflags,
144 version: meson.project_version(),
145 soversion: splitted_version[0],
148 libmpdclient_dep = declare_dependency(link_with: libmpdclient)
150 executable('example',
152 include_directories: inc,
158 'include/mpd/async.h',
159 'include/mpd/audio_format.h',
160 'include/mpd/client.h',
161 'include/mpd/capabilities.h',
162 'include/mpd/compiler.h',
163 'include/mpd/connection.h',
164 'include/mpd/database.h',
165 'include/mpd/directory.h',
166 'include/mpd/entity.h',
167 'include/mpd/error.h',
168 'include/mpd/idle.h',
169 'include/mpd/list.h',
170 'include/mpd/mixer.h',
171 'include/mpd/parser.h',
172 'include/mpd/password.h',
173 'include/mpd/player.h',
174 'include/mpd/playlist.h',
175 'include/mpd/protocol.h',
176 'include/mpd/queue.h',
177 'include/mpd/recv.h',
178 'include/mpd/response.h',
179 'include/mpd/send.h',
180 'include/mpd/status.h',
181 'include/mpd/stats.h',
183 'include/mpd/output.h',
184 'include/mpd/pair.h',
185 'include/mpd/search.h',
186 'include/mpd/socket.h',
187 'include/mpd/song.h',
188 'include/mpd/sticker.h',
189 'include/mpd/settings.h',
190 'include/mpd/message.h',
191 join_paths(meson.build_root(), 'version.h'),
194 docdir = join_paths(get_option('datadir'), 'doc', meson.project_name())
195 install_data('AUTHORS', 'COPYING', 'NEWS', 'README.rst',
198 install_data('vapi/libmpdclient.vapi',
199 install_dir : join_paths(get_option('datadir'), 'vala', 'vapi'))
201 pkg_mod = import('pkgconfig')
203 libraries: libmpdclient,
204 version: meson.project_version(),
205 name: 'libmpdclient',
206 description: 'Music Player Daemon client library',
209 if get_option('documentation')
210 doxygen = find_program('doxygen', required: false)
216 if get_option('test')
217 check_dep = dependency('check')