2017-12-29 17:12:55 +01:00
|
|
|
project(
|
|
|
|
'mpd',
|
|
|
|
['c', 'cpp'],
|
2021-12-03 23:01:16 +01:00
|
|
|
version: '0.24',
|
2021-09-21 13:38:50 +02:00
|
|
|
meson_version: '>= 0.56.0',
|
2017-12-29 17:12:55 +01:00
|
|
|
default_options: [
|
2020-11-04 14:38:05 +01:00
|
|
|
'c_std=c11',
|
|
|
|
'build.c_std=c11',
|
2022-05-19 09:46:34 +02:00
|
|
|
'cpp_std=c++2a',
|
|
|
|
'build.cpp_std=c++2a',
|
2020-05-27 15:36:49 +02:00
|
|
|
'warning_level=3',
|
2020-06-04 18:43:33 +02:00
|
|
|
|
2024-03-11 15:13:01 +01:00
|
|
|
'fmt:cpp_std=c++2a',
|
|
|
|
|
2021-09-21 13:37:20 +02:00
|
|
|
# If we build those libraries as Meson subproject, they shall be
|
|
|
|
# linked statically into the MPD executable.
|
2023-12-11 10:02:35 +01:00
|
|
|
'curl:default_library=static',
|
2021-09-21 14:02:45 +02:00
|
|
|
'expat:default_library=static',
|
2023-12-11 10:02:59 +01:00
|
|
|
'flac:default_library=static',
|
2021-09-21 13:37:20 +02:00
|
|
|
'fmt:default_library=static',
|
|
|
|
'gtest:default_library=static',
|
2023-12-22 17:10:57 +01:00
|
|
|
'id3tag:default_library=static',
|
2023-12-11 11:06:52 +01:00
|
|
|
'lame:default_library=static',
|
2023-12-20 17:06:15 +01:00
|
|
|
'libmpdclient:default_library=static',
|
2023-12-09 21:00:16 +01:00
|
|
|
'liburing:default_library=static',
|
2023-12-11 10:02:59 +01:00
|
|
|
'ogg:default_library=static',
|
2023-12-11 10:58:10 +01:00
|
|
|
'openssl:default_library=static',
|
2023-12-11 10:02:59 +01:00
|
|
|
'opus:default_library=static',
|
2021-09-21 13:37:20 +02:00
|
|
|
'sqlite3:default_library=static',
|
2021-09-21 13:01:32 +02:00
|
|
|
'vorbis:default_library=static',
|
2021-09-21 13:44:22 +02:00
|
|
|
|
|
|
|
# Not interested in compiler warnings from subprojects.
|
2023-12-11 10:02:35 +01:00
|
|
|
'curl:werror=false',
|
|
|
|
'curl:warning_level=0',
|
2021-09-21 14:02:45 +02:00
|
|
|
'expat:werror=false',
|
|
|
|
'expat:warning_level=0',
|
2023-12-11 10:02:59 +01:00
|
|
|
'flac:werror=false',
|
|
|
|
'flac:warning_level=0',
|
2021-09-21 13:44:22 +02:00
|
|
|
'fmt:warning_level=0',
|
|
|
|
'gtest:warning_level=0',
|
2023-12-22 17:10:57 +01:00
|
|
|
'id3tag:werror=false',
|
|
|
|
'id3tag:warning_level=0',
|
2023-12-11 11:06:52 +01:00
|
|
|
'lame:werror=false',
|
|
|
|
'lame:warning_level=0',
|
2023-12-09 21:00:16 +01:00
|
|
|
'liburing:warning_level=0',
|
2021-09-21 13:44:22 +02:00
|
|
|
'sqlite3:warning_level=0',
|
2023-12-11 10:02:59 +01:00
|
|
|
'oggiopus:werror=false',
|
|
|
|
'ogg:warning_level=0',
|
2023-12-11 10:58:10 +01:00
|
|
|
'openssl:werror=false',
|
|
|
|
'openssl:warning_level=0',
|
2023-12-11 10:02:59 +01:00
|
|
|
'opus:werror=false',
|
|
|
|
'opus:warning_level=0',
|
2021-09-21 13:01:32 +02:00
|
|
|
'vorbis:warning_level=0',
|
2023-12-11 10:02:59 +01:00
|
|
|
|
|
|
|
# Disable subprojects features we don't need
|
2023-12-11 10:02:35 +01:00
|
|
|
'curl:tool=disabled',
|
|
|
|
'curl:tests=disabled',
|
|
|
|
'curl:unittests=disabled',
|
|
|
|
'curl:brotli=disabled',
|
|
|
|
'curl:cookies=disabled',
|
|
|
|
'curl:progress-meter=disabled',
|
|
|
|
'curl:zstd=disabled',
|
|
|
|
'curl:kerberos-auth=disabled',
|
|
|
|
'curl:negotiate-auth=disabled',
|
|
|
|
'curl:gss-api=disabled',
|
|
|
|
'curl:ntlm=disabled',
|
|
|
|
'curl:ssh=disabled',
|
|
|
|
'curl:dict=disabled',
|
|
|
|
'curl:file=disabled',
|
|
|
|
'curl:ftp=disabled',
|
|
|
|
'curl:gopher=disabled',
|
|
|
|
'curl:imap=disabled',
|
|
|
|
'curl:ldap=disabled',
|
|
|
|
'curl:ldaps=disabled',
|
|
|
|
'curl:mqtt=disabled',
|
|
|
|
'curl:pop3=disabled',
|
|
|
|
'curl:rtmp=disabled',
|
|
|
|
'curl:rtsp=disabled',
|
|
|
|
'curl:smb=disabled',
|
|
|
|
'curl:smtp=disabled',
|
|
|
|
'curl:telnet=disabled',
|
|
|
|
'curl:tftp=disabled',
|
2023-12-11 11:06:52 +01:00
|
|
|
'lame:decoder=false',
|
|
|
|
'lame:tools=disabled',
|
2023-12-20 17:06:15 +01:00
|
|
|
'libmpdclient:documentation=false',
|
|
|
|
'libmpdclient:test=false',
|
2023-12-11 10:58:10 +01:00
|
|
|
'openssl:build_cli=false',
|
2024-04-24 00:24:54 +02:00
|
|
|
'openssl:asm=disabled',
|
2023-12-11 10:02:59 +01:00
|
|
|
'opus:docs=disabled',
|
|
|
|
'opus:extra-programs=disabled',
|
|
|
|
'opus:tests=disabled',
|
2017-12-29 17:12:55 +01:00
|
|
|
],
|
|
|
|
license: 'GPLv2+',
|
|
|
|
)
|
|
|
|
|
|
|
|
version_cxx = vcs_tag(input: 'src/GitVersion.cxx', output: 'GitVersion.cxx')
|
|
|
|
|
|
|
|
compiler = meson.get_compiler('cpp')
|
|
|
|
c_compiler = meson.get_compiler('c')
|
|
|
|
|
2020-05-07 12:41:40 +02:00
|
|
|
if compiler.get_id() == 'gcc' and compiler.version().version_compare('<8')
|
|
|
|
warning('Your GCC version is too old. You need at least version 8.')
|
2021-05-25 21:05:57 +02:00
|
|
|
elif compiler.get_id() == 'clang' and compiler.version().version_compare('<7')
|
|
|
|
warning('Your clang version is too old. You need at least version 7.')
|
2019-08-02 15:52:35 +02:00
|
|
|
endif
|
|
|
|
|
2020-05-05 15:08:55 +02:00
|
|
|
version_conf = configuration_data()
|
|
|
|
version_conf.set_quoted('PACKAGE', meson.project_name())
|
|
|
|
version_conf.set_quoted('PACKAGE_NAME', meson.project_name())
|
|
|
|
version_conf.set_quoted('VERSION', meson.project_version())
|
2022-02-15 23:12:06 +01:00
|
|
|
version_conf.set_quoted('PROTOCOL_VERSION', '0.24.0')
|
2020-05-05 15:08:55 +02:00
|
|
|
configure_file(output: 'Version.h', configuration: version_conf)
|
|
|
|
|
2017-12-29 17:12:55 +01:00
|
|
|
conf = configuration_data()
|
|
|
|
conf.set_quoted('SYSTEM_CONFIG_FILE_LOCATION', join_paths(get_option('prefix'), get_option('sysconfdir'), 'mpd.conf'))
|
|
|
|
|
2023-12-20 17:40:47 +01:00
|
|
|
common_global_cppflags = [
|
2017-12-29 17:12:55 +01:00
|
|
|
'-D_GNU_SOURCE',
|
|
|
|
]
|
|
|
|
|
2023-12-20 17:40:47 +01:00
|
|
|
common_cppflags = [
|
|
|
|
]
|
|
|
|
|
2021-05-25 20:49:27 +02:00
|
|
|
test_global_common_flags = [
|
|
|
|
'-fvisibility=hidden',
|
2017-12-29 17:12:55 +01:00
|
|
|
]
|
|
|
|
|
|
|
|
test_common_flags = [
|
2021-06-01 11:14:24 +02:00
|
|
|
'-ffast-math',
|
|
|
|
'-ftree-vectorize',
|
|
|
|
|
2021-06-01 11:03:41 +02:00
|
|
|
'-Wcast-qual',
|
2020-09-22 20:24:23 +02:00
|
|
|
'-Wdouble-promotion',
|
2021-06-01 11:14:24 +02:00
|
|
|
'-Wmissing-declarations',
|
2021-06-01 11:03:41 +02:00
|
|
|
'-Wshadow',
|
2021-06-01 11:14:24 +02:00
|
|
|
'-Wunused',
|
2021-06-01 11:03:41 +02:00
|
|
|
'-Wvla',
|
|
|
|
'-Wwrite-strings',
|
2019-06-06 12:31:08 +02:00
|
|
|
|
2021-06-01 11:14:24 +02:00
|
|
|
# clang specific warning options:
|
|
|
|
'-Wunreachable-code-aggressive',
|
|
|
|
'-Wused-but-marked-unused',
|
2022-05-24 10:39:17 +02:00
|
|
|
|
|
|
|
# suppress bogus GCC12 warnings in libfmt headers
|
|
|
|
'-Wno-stringop-overflow',
|
2024-03-11 15:15:13 +01:00
|
|
|
|
|
|
|
# libfmt causes this warning due to -ffast-math
|
|
|
|
'-Wno-nan-infinity-disabled',
|
2017-12-29 17:12:55 +01:00
|
|
|
]
|
|
|
|
|
2021-05-25 20:49:27 +02:00
|
|
|
test_global_cxxflags = test_global_common_flags + [
|
|
|
|
]
|
|
|
|
|
|
|
|
test_global_cflags = test_global_common_flags + [
|
|
|
|
]
|
|
|
|
|
2017-12-29 17:12:55 +01:00
|
|
|
test_cxxflags = test_common_flags + [
|
|
|
|
'-fno-threadsafe-statics',
|
|
|
|
'-fmerge-all-constants',
|
|
|
|
|
2021-05-25 21:30:04 +02:00
|
|
|
'-Wcomma-subscript',
|
2020-03-16 21:51:59 +01:00
|
|
|
'-Wextra-semi',
|
2021-05-25 21:30:04 +02:00
|
|
|
'-Wmismatched-tags',
|
|
|
|
'-Woverloaded-virtual',
|
|
|
|
'-Wsign-promo',
|
|
|
|
'-Wvolatile',
|
|
|
|
'-Wvirtual-inheritance',
|
2021-05-25 21:37:10 +02:00
|
|
|
|
2021-05-25 21:47:57 +02:00
|
|
|
# a vtable without a dtor is just fine
|
2021-05-25 21:37:10 +02:00
|
|
|
'-Wno-non-virtual-dtor',
|
|
|
|
|
|
|
|
# clang specific warning options:
|
2020-03-16 21:51:59 +01:00
|
|
|
'-Wcomma',
|
|
|
|
'-Wheader-hygiene',
|
|
|
|
'-Winconsistent-missing-destructor-override',
|
2018-10-31 19:30:01 +01:00
|
|
|
]
|
2018-10-30 13:33:10 +01:00
|
|
|
|
2021-05-25 22:22:40 +02:00
|
|
|
if compiler.get_id() != 'gcc' or compiler.version().version_compare('>=9')
|
|
|
|
# The GCC 8 implementation of this flag is buggy: it complains even
|
|
|
|
# if "final" is present, which implies "override".
|
|
|
|
test_cxxflags += '-Wsuggest-override'
|
2018-10-31 19:30:01 +01:00
|
|
|
endif
|
2017-12-29 17:12:55 +01:00
|
|
|
|
|
|
|
test_cflags = test_common_flags + [
|
|
|
|
'-Wmissing-prototypes',
|
|
|
|
'-Wstrict-prototypes',
|
|
|
|
]
|
|
|
|
|
|
|
|
test_ldflags = [
|
2020-11-04 13:38:20 +01:00
|
|
|
# make relocations read-only (hardening)
|
|
|
|
'-Wl,-z,relro',
|
|
|
|
|
|
|
|
# no lazy binding, please - not worth it for a daemon
|
|
|
|
'-Wl,-z,now',
|
2017-12-29 17:12:55 +01:00
|
|
|
]
|
|
|
|
|
|
|
|
if get_option('buildtype') != 'debug'
|
2021-05-25 20:49:27 +02:00
|
|
|
test_global_cxxflags += [
|
2020-01-14 17:44:44 +01:00
|
|
|
'-ffunction-sections',
|
|
|
|
'-fdata-sections',
|
|
|
|
]
|
2021-05-25 20:49:27 +02:00
|
|
|
test_global_cflags += [
|
2017-12-29 17:12:55 +01:00
|
|
|
'-ffunction-sections',
|
|
|
|
'-fdata-sections',
|
|
|
|
]
|
|
|
|
test_ldflags += [
|
|
|
|
'-Wl,--gc-sections',
|
|
|
|
]
|
|
|
|
endif
|
|
|
|
|
2020-10-05 19:46:18 +02:00
|
|
|
if get_option('fuzzer')
|
2022-10-20 18:26:57 +02:00
|
|
|
fuzzer_flags = []
|
|
|
|
if get_option('libfuzzer')
|
|
|
|
fuzzer_flags += ['-fsanitize=fuzzer']
|
|
|
|
endif
|
2021-05-23 20:34:39 +02:00
|
|
|
if get_option('b_sanitize') == 'none'
|
|
|
|
fuzzer_flags += ['-fsanitize=address,undefined']
|
|
|
|
endif
|
2020-10-05 19:46:18 +02:00
|
|
|
add_global_arguments(fuzzer_flags, language: 'cpp')
|
|
|
|
add_global_arguments(fuzzer_flags, language: 'c')
|
|
|
|
add_global_link_arguments(fuzzer_flags, language: 'cpp')
|
|
|
|
endif
|
|
|
|
|
2021-05-25 20:49:27 +02:00
|
|
|
add_global_arguments(compiler.get_supported_arguments(test_global_cxxflags), language: 'cpp')
|
|
|
|
add_global_arguments(c_compiler.get_supported_arguments(test_global_cflags), language: 'c')
|
|
|
|
add_project_arguments(compiler.get_supported_arguments(test_cxxflags), language: 'cpp')
|
|
|
|
add_project_arguments(c_compiler.get_supported_arguments(test_cflags), language: 'c')
|
|
|
|
add_project_link_arguments(compiler.get_supported_link_arguments(test_ldflags), language: 'cpp')
|
2017-12-29 17:12:55 +01:00
|
|
|
|
|
|
|
is_linux = host_machine.system() == 'linux'
|
|
|
|
is_android = get_option('android_ndk') != ''
|
|
|
|
is_darwin = host_machine.system() == 'darwin'
|
|
|
|
is_windows = host_machine.system() == 'windows'
|
|
|
|
|
|
|
|
if is_android
|
|
|
|
common_cppflags += '-DANDROID'
|
|
|
|
endif
|
|
|
|
|
|
|
|
if is_windows
|
|
|
|
common_cppflags += [
|
2021-05-19 17:15:11 +02:00
|
|
|
# enable Windows Vista APIs
|
2017-12-29 17:12:55 +01:00
|
|
|
'-DWINVER=0x0600', '-D_WIN32_WINNT=0x0600',
|
2021-05-19 17:15:11 +02:00
|
|
|
|
|
|
|
# enable Unicode support (TCHAR=wchar_t) in the Windows API (macro
|
|
|
|
# "UNICODE) and the C library (macro "_UNICODE")
|
2017-12-29 17:12:55 +01:00
|
|
|
'-DUNICODE', '-D_UNICODE',
|
2021-05-19 17:15:11 +02:00
|
|
|
|
|
|
|
# enable strict type checking in the Windows API headers
|
|
|
|
'-DSTRICT',
|
|
|
|
|
|
|
|
# reduce header bloat by disabling obscure and obsolete Windows
|
|
|
|
# APIs
|
|
|
|
'-DWIN32_LEAN_AND_MEAN',
|
2021-05-19 16:22:27 +02:00
|
|
|
|
|
|
|
# disable more Windows APIs which are not used by MPD
|
|
|
|
'-DNOGDI', '-DNOBITMAP', '-DNOCOMM',
|
2021-05-19 17:27:51 +02:00
|
|
|
'-DNOUSER',
|
|
|
|
|
|
|
|
# reduce COM header bloat
|
|
|
|
'-DCOM_NO_WINDOWS_H',
|
2021-05-19 16:22:27 +02:00
|
|
|
|
|
|
|
# disable Internet Explorer specific APIs
|
|
|
|
'-D_WIN32_IE=0',
|
2017-12-29 17:12:55 +01:00
|
|
|
]
|
|
|
|
|
|
|
|
subdir('win32')
|
|
|
|
endif
|
|
|
|
|
|
|
|
if is_android
|
2024-04-21 03:43:17 +02:00
|
|
|
# With ndk27 libcpp doesn't seem to have a rune table defined for the
|
|
|
|
# localization module, tell it to use the one it ships with
|
|
|
|
common_cppflags += ['-D_LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE']
|
|
|
|
|
2017-12-29 17:12:55 +01:00
|
|
|
subdir('android')
|
|
|
|
endif
|
|
|
|
|
2023-12-20 17:40:47 +01:00
|
|
|
add_global_arguments(common_global_cppflags, language: 'c')
|
|
|
|
add_global_arguments(common_global_cppflags, language: 'cpp')
|
|
|
|
|
|
|
|
add_project_arguments(common_cppflags, language: 'c')
|
|
|
|
add_project_arguments(common_cppflags, language: 'cpp')
|
2017-12-29 17:12:55 +01:00
|
|
|
|
|
|
|
enable_daemon = not is_windows and not is_android and get_option('daemon')
|
|
|
|
conf.set('ENABLE_DAEMON', enable_daemon)
|
|
|
|
|
|
|
|
conf.set('HAVE_GETPWNAM_R', compiler.has_function('getpwnam_r'))
|
|
|
|
conf.set('HAVE_INITGROUPS', compiler.has_function('initgroups'))
|
|
|
|
conf.set('HAVE_FNMATCH', compiler.has_function('fnmatch'))
|
2020-05-26 20:50:16 +02:00
|
|
|
|
|
|
|
# Explicitly exclude Windows in this check because
|
|
|
|
# https://github.com/mesonbuild/meson/issues/3672 (reported in 2018,
|
|
|
|
# still not fixed in 2020) causes Meson to believe it exists, because
|
|
|
|
# __builtin_strndup() exists (but strndup() still cannot be used).
|
|
|
|
conf.set('HAVE_STRNDUP', not is_windows and compiler.has_function('strndup', prefix: '#define _GNU_SOURCE\n#include <string.h>'))
|
|
|
|
|
2017-12-29 17:12:55 +01:00
|
|
|
conf.set('HAVE_STRCASESTR', compiler.has_function('strcasestr'))
|
|
|
|
|
|
|
|
conf.set('HAVE_PRCTL', is_linux)
|
|
|
|
|
|
|
|
if not get_option('syslog').disabled()
|
|
|
|
if compiler.has_function('syslog')
|
|
|
|
conf.set('HAVE_SYSLOG', true)
|
|
|
|
elif get_option('syslog').enabled()
|
|
|
|
error('syslog() not found')
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
enable_database = get_option('database')
|
|
|
|
conf.set('ENABLE_DATABASE', enable_database)
|
|
|
|
|
|
|
|
enable_inotify = get_option('inotify') and is_linux and enable_database
|
|
|
|
conf.set('ENABLE_INOTIFY', enable_inotify)
|
|
|
|
|
|
|
|
conf.set('ENABLE_DSD', get_option('dsd'))
|
|
|
|
|
|
|
|
inc = include_directories(
|
|
|
|
'src',
|
|
|
|
|
|
|
|
# for the generated config.h
|
|
|
|
'.',
|
|
|
|
)
|
|
|
|
|
2022-11-28 22:09:48 +01:00
|
|
|
subdir('src/lib/fmt')
|
2022-10-14 22:54:33 +02:00
|
|
|
|
2020-01-18 19:45:56 +01:00
|
|
|
log = static_library(
|
|
|
|
'log',
|
|
|
|
'src/Log.cxx',
|
|
|
|
'src/LogBackend.cxx',
|
|
|
|
include_directories: inc,
|
2021-06-23 21:55:08 +02:00
|
|
|
dependencies: fmt_dep,
|
2020-01-18 19:45:56 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
log_dep = declare_dependency(
|
|
|
|
link_with: log,
|
2021-06-23 21:55:08 +02:00
|
|
|
dependencies: fmt_dep,
|
2020-01-18 19:45:56 +01:00
|
|
|
)
|
|
|
|
|
2017-12-29 17:12:55 +01:00
|
|
|
sources = [
|
|
|
|
version_cxx,
|
|
|
|
'src/Main.cxx',
|
|
|
|
'src/protocol/ArgParser.cxx',
|
|
|
|
'src/command/CommandError.cxx',
|
2021-10-18 21:51:02 +02:00
|
|
|
'src/command/PositionArg.cxx',
|
2017-12-29 17:12:55 +01:00
|
|
|
'src/command/AllCommands.cxx',
|
|
|
|
'src/command/QueueCommands.cxx',
|
|
|
|
'src/command/TagCommands.cxx',
|
|
|
|
'src/command/PlayerCommands.cxx',
|
|
|
|
'src/command/PlaylistCommands.cxx',
|
|
|
|
'src/command/FileCommands.cxx',
|
|
|
|
'src/command/OutputCommands.cxx',
|
|
|
|
'src/command/MessageCommands.cxx',
|
|
|
|
'src/command/ClientCommands.cxx',
|
|
|
|
'src/command/PartitionCommands.cxx',
|
|
|
|
'src/command/OtherCommands.cxx',
|
|
|
|
'src/command/CommandListBuilder.cxx',
|
2021-12-03 20:22:52 +01:00
|
|
|
'src/config/PartitionConfig.cxx',
|
|
|
|
'src/config/PlayerConfig.cxx',
|
2021-12-03 23:04:39 +01:00
|
|
|
'src/config/ReplayGainConfig.cxx',
|
2017-12-29 17:12:55 +01:00
|
|
|
'src/Idle.cxx',
|
|
|
|
'src/IdleFlags.cxx',
|
|
|
|
'src/decoder/Thread.cxx',
|
|
|
|
'src/decoder/Control.cxx',
|
|
|
|
'src/decoder/Bridge.cxx',
|
|
|
|
'src/decoder/DecoderPrint.cxx',
|
|
|
|
'src/client/Listener.cxx',
|
|
|
|
'src/client/Client.cxx',
|
2019-04-03 21:31:32 +02:00
|
|
|
'src/client/Config.cxx',
|
2019-04-03 21:26:16 +02:00
|
|
|
'src/client/Domain.cxx',
|
2019-04-03 20:59:00 +02:00
|
|
|
'src/client/Event.cxx',
|
|
|
|
'src/client/Expire.cxx',
|
|
|
|
'src/client/Idle.cxx',
|
|
|
|
'src/client/List.cxx',
|
|
|
|
'src/client/New.cxx',
|
|
|
|
'src/client/Process.cxx',
|
|
|
|
'src/client/Read.cxx',
|
|
|
|
'src/client/Write.cxx',
|
|
|
|
'src/client/Message.cxx',
|
|
|
|
'src/client/Subscribe.cxx',
|
|
|
|
'src/client/File.cxx',
|
2017-12-29 17:12:55 +01:00
|
|
|
'src/client/Response.cxx',
|
2019-04-03 14:31:57 +02:00
|
|
|
'src/client/ThreadBackgroundCommand.cxx',
|
2017-12-29 17:12:55 +01:00
|
|
|
'src/Listen.cxx',
|
|
|
|
'src/LogInit.cxx',
|
|
|
|
'src/ls.cxx',
|
|
|
|
'src/Instance.cxx',
|
|
|
|
'src/MusicBuffer.cxx',
|
|
|
|
'src/MusicPipe.cxx',
|
|
|
|
'src/MusicChunk.cxx',
|
|
|
|
'src/MusicChunkPtr.cxx',
|
|
|
|
'src/Mapper.cxx',
|
|
|
|
'src/Partition.cxx',
|
|
|
|
'src/Permission.cxx',
|
|
|
|
'src/player/CrossFade.cxx',
|
|
|
|
'src/player/Thread.cxx',
|
|
|
|
'src/player/Control.cxx',
|
|
|
|
'src/PlaylistError.cxx',
|
|
|
|
'src/PlaylistPrint.cxx',
|
|
|
|
'src/PlaylistSave.cxx',
|
2024-02-08 22:54:24 +01:00
|
|
|
'src/playlist/Length.cxx',
|
2017-12-29 17:12:55 +01:00
|
|
|
'src/playlist/PlaylistStream.cxx',
|
|
|
|
'src/playlist/PlaylistMapper.cxx',
|
|
|
|
'src/playlist/PlaylistAny.cxx',
|
|
|
|
'src/playlist/PlaylistSong.cxx',
|
|
|
|
'src/playlist/PlaylistQueue.cxx',
|
|
|
|
'src/playlist/Print.cxx',
|
|
|
|
'src/db/PlaylistVector.cxx',
|
|
|
|
'src/queue/Queue.cxx',
|
2022-02-14 06:08:11 +01:00
|
|
|
'src/queue/Print.cxx',
|
|
|
|
'src/queue/Save.cxx',
|
2022-02-12 08:19:36 +01:00
|
|
|
'src/queue/Selection.cxx',
|
2017-12-29 17:12:55 +01:00
|
|
|
'src/queue/Playlist.cxx',
|
|
|
|
'src/queue/PlaylistControl.cxx',
|
|
|
|
'src/queue/PlaylistEdit.cxx',
|
|
|
|
'src/queue/PlaylistTag.cxx',
|
|
|
|
'src/queue/PlaylistState.cxx',
|
|
|
|
'src/LocateUri.cxx',
|
|
|
|
'src/SongUpdate.cxx',
|
|
|
|
'src/SongLoader.cxx',
|
|
|
|
'src/SongPrint.cxx',
|
|
|
|
'src/SongSave.cxx',
|
|
|
|
'src/StateFile.cxx',
|
|
|
|
'src/StateFileConfig.cxx',
|
|
|
|
'src/Stats.cxx',
|
|
|
|
'src/TagPrint.cxx',
|
|
|
|
'src/TagSave.cxx',
|
|
|
|
'src/TagFile.cxx',
|
|
|
|
'src/TagStream.cxx',
|
2019-08-12 19:24:24 +02:00
|
|
|
'src/TagAny.cxx',
|
2017-12-29 17:12:55 +01:00
|
|
|
'src/TimePrint.cxx',
|
2022-08-08 23:15:09 +02:00
|
|
|
'src/mixer/Memento.cxx',
|
2017-12-29 17:12:55 +01:00
|
|
|
'src/PlaylistFile.cxx',
|
|
|
|
]
|
|
|
|
|
2021-03-04 18:42:51 +01:00
|
|
|
if is_windows
|
|
|
|
sources += [
|
|
|
|
'src/win32/Win32Main.cxx',
|
|
|
|
]
|
|
|
|
endif
|
|
|
|
|
2017-12-29 17:12:55 +01:00
|
|
|
if not is_android
|
|
|
|
sources += [
|
|
|
|
'src/CommandLine.cxx',
|
|
|
|
'src/unix/SignalHandlers.cxx',
|
|
|
|
]
|
|
|
|
else
|
|
|
|
sources += [
|
|
|
|
'src/android/Context.cxx',
|
2020-03-23 18:15:07 +01:00
|
|
|
'src/android/AudioManager.cxx',
|
2017-12-29 17:12:55 +01:00
|
|
|
'src/android/Environment.cxx',
|
|
|
|
'src/android/LogListener.cxx',
|
|
|
|
]
|
|
|
|
endif
|
|
|
|
|
|
|
|
if enable_daemon
|
|
|
|
sources += 'src/unix/Daemon.cxx'
|
|
|
|
endif
|
|
|
|
|
|
|
|
if enable_database
|
|
|
|
sources += [
|
2022-11-12 12:19:41 +01:00
|
|
|
'src/storage/StorageState.cxx',
|
2017-12-29 17:12:55 +01:00
|
|
|
'src/queue/PlaylistUpdate.cxx',
|
|
|
|
'src/command/StorageCommands.cxx',
|
|
|
|
'src/command/DatabaseCommands.cxx',
|
|
|
|
]
|
|
|
|
endif
|
|
|
|
|
|
|
|
subdir('src/util')
|
2022-11-29 11:27:59 +01:00
|
|
|
subdir('src/cmdline')
|
2019-05-08 15:47:58 +02:00
|
|
|
subdir('src/time')
|
2023-03-07 12:25:30 +01:00
|
|
|
subdir('src/lib/icu')
|
|
|
|
subdir('src/fs')
|
2020-05-05 14:11:13 +02:00
|
|
|
subdir('src/io')
|
2020-05-05 14:28:15 +02:00
|
|
|
subdir('src/io/uring')
|
2017-12-29 17:12:55 +01:00
|
|
|
subdir('src/system')
|
|
|
|
subdir('src/thread')
|
2020-04-02 17:10:44 +02:00
|
|
|
subdir('src/net')
|
2017-12-29 17:12:55 +01:00
|
|
|
subdir('src/event')
|
2021-03-05 13:25:24 +01:00
|
|
|
subdir('src/win32')
|
2017-12-29 17:12:55 +01:00
|
|
|
|
2023-11-25 22:04:11 +01:00
|
|
|
subdir('src/fs/glue')
|
|
|
|
|
|
|
|
subdir('src/config')
|
2022-11-29 08:43:23 +01:00
|
|
|
subdir('src/pcm')
|
|
|
|
|
2017-12-29 17:12:55 +01:00
|
|
|
subdir('src/lib/dbus')
|
|
|
|
subdir('src/lib/smbclient')
|
|
|
|
subdir('src/lib/zlib')
|
|
|
|
|
|
|
|
subdir('src/lib/alsa')
|
2019-04-05 13:51:15 +02:00
|
|
|
subdir('src/lib/chromaprint')
|
2017-12-29 17:12:55 +01:00
|
|
|
subdir('src/lib/curl')
|
|
|
|
subdir('src/lib/expat')
|
|
|
|
subdir('src/lib/ffmpeg')
|
|
|
|
subdir('src/lib/gcrypt')
|
|
|
|
subdir('src/lib/nfs')
|
|
|
|
subdir('src/lib/oss')
|
2018-11-07 00:28:15 +01:00
|
|
|
subdir('src/lib/pcre')
|
2021-03-03 15:15:24 +01:00
|
|
|
subdir('src/lib/pipewire')
|
2017-12-29 17:12:55 +01:00
|
|
|
subdir('src/lib/pulse')
|
|
|
|
subdir('src/lib/sndio')
|
|
|
|
subdir('src/lib/sqlite')
|
|
|
|
subdir('src/lib/systemd')
|
|
|
|
subdir('src/lib/upnp')
|
|
|
|
subdir('src/lib/yajl')
|
|
|
|
|
2019-08-13 17:20:07 +02:00
|
|
|
subdir('src/lib/crypto')
|
|
|
|
|
2021-02-23 22:12:43 +01:00
|
|
|
subdir('src/zeroconf')
|
|
|
|
|
2017-12-29 17:12:55 +01:00
|
|
|
subdir('src/tag')
|
|
|
|
subdir('src/neighbor')
|
|
|
|
subdir('src/input')
|
|
|
|
subdir('src/archive')
|
|
|
|
subdir('src/filter')
|
|
|
|
subdir('src/mixer')
|
|
|
|
subdir('src/output')
|
|
|
|
subdir('src/lib/xiph')
|
|
|
|
subdir('src/decoder')
|
|
|
|
subdir('src/encoder')
|
|
|
|
subdir('src/song')
|
|
|
|
subdir('src/playlist')
|
|
|
|
|
|
|
|
if curl_dep.found()
|
|
|
|
sources += 'src/RemoteTagCache.cxx'
|
|
|
|
endif
|
|
|
|
|
|
|
|
if sqlite_dep.found()
|
|
|
|
sources += [
|
|
|
|
'src/command/StickerCommands.cxx',
|
2019-04-24 15:15:19 +02:00
|
|
|
'src/sticker/Database.cxx',
|
|
|
|
'src/sticker/Print.cxx',
|
2017-12-29 17:12:55 +01:00
|
|
|
'src/sticker/SongSticker.cxx',
|
2022-10-29 18:58:42 +02:00
|
|
|
'src/sticker/TagSticker.cxx',
|
|
|
|
'src/sticker/AllowedTags.cxx',
|
|
|
|
'src/sticker/CleanupService.cxx',
|
2017-12-29 17:12:55 +01:00
|
|
|
]
|
|
|
|
endif
|
|
|
|
|
2019-04-05 12:38:49 +02:00
|
|
|
if chromaprint_dep.found()
|
|
|
|
sources += [
|
|
|
|
'src/command/FingerprintCommands.cxx',
|
|
|
|
'src/lib/chromaprint/DecoderClient.cxx',
|
|
|
|
]
|
|
|
|
endif
|
|
|
|
|
2017-12-29 17:12:55 +01:00
|
|
|
basic = static_library(
|
|
|
|
'basic',
|
|
|
|
'src/ReplayGainMode.cxx',
|
|
|
|
'src/SingleMode.cxx',
|
2022-08-28 19:07:34 +02:00
|
|
|
'src/ConsumeMode.cxx',
|
2017-12-29 17:12:55 +01:00
|
|
|
include_directories: inc,
|
|
|
|
)
|
|
|
|
|
|
|
|
basic_dep = declare_dependency(
|
|
|
|
link_with: basic,
|
|
|
|
)
|
|
|
|
|
|
|
|
if enable_database
|
|
|
|
subdir('src/storage')
|
2019-04-16 12:28:08 +02:00
|
|
|
else
|
|
|
|
storage_glue_dep = dependency('', required: false)
|
2017-12-29 17:12:55 +01:00
|
|
|
endif
|
2019-04-16 12:28:08 +02:00
|
|
|
subdir('src/db')
|
2017-12-29 17:12:55 +01:00
|
|
|
|
|
|
|
if neighbor_glue_dep.found()
|
|
|
|
sources += 'src/command/NeighborCommands.cxx'
|
|
|
|
endif
|
|
|
|
|
|
|
|
if archive_glue_dep.found()
|
|
|
|
sources += [
|
|
|
|
'src/TagArchive.cxx',
|
|
|
|
]
|
2019-11-04 14:12:07 +01:00
|
|
|
|
|
|
|
if enable_database
|
|
|
|
sources += ['src/db/update/Archive.cxx']
|
|
|
|
endif
|
2017-12-29 17:12:55 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
if is_windows
|
|
|
|
sources += windows_resources
|
|
|
|
endif
|
|
|
|
|
|
|
|
link_args = []
|
|
|
|
more_deps = []
|
|
|
|
if is_android
|
|
|
|
subdir('src/java')
|
|
|
|
target_type = 'shared_library'
|
2019-03-26 23:13:54 +01:00
|
|
|
target_name = 'mpd'
|
2017-12-29 17:12:55 +01:00
|
|
|
link_args += [
|
|
|
|
'-Wl,--no-undefined,-shared,-Bsymbolic',
|
|
|
|
'-llog',
|
|
|
|
'-lz',
|
|
|
|
]
|
|
|
|
more_deps += [
|
2023-12-18 05:38:10 +01:00
|
|
|
declare_dependency(sources: [bridge_header]),
|
2017-12-29 17:12:55 +01:00
|
|
|
java_dep,
|
|
|
|
]
|
2024-01-18 19:33:16 +01:00
|
|
|
|
|
|
|
android_abi = get_option('android_abi')
|
|
|
|
install_dir = meson.current_source_dir() / 'android/app/src/main/jnilibs' / android_abi
|
2017-12-29 17:12:55 +01:00
|
|
|
else
|
|
|
|
target_type = 'executable'
|
2019-03-26 23:13:54 +01:00
|
|
|
target_name = 'mpd'
|
2024-01-18 19:33:16 +01:00
|
|
|
install_dir = ''
|
2017-12-29 17:12:55 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
mpd = build_target(
|
2019-03-26 23:13:54 +01:00
|
|
|
target_name,
|
2017-12-29 17:12:55 +01:00
|
|
|
sources,
|
|
|
|
target_type: target_type,
|
|
|
|
include_directories: inc,
|
|
|
|
dependencies: [
|
2022-11-29 11:27:59 +01:00
|
|
|
cmdline_dep,
|
2017-12-29 17:12:55 +01:00
|
|
|
basic_dep,
|
|
|
|
config_dep,
|
|
|
|
dbus_dep,
|
|
|
|
fs_dep,
|
|
|
|
net_dep,
|
|
|
|
util_dep,
|
|
|
|
event_dep,
|
|
|
|
thread_dep,
|
|
|
|
neighbor_glue_dep,
|
|
|
|
input_glue_dep,
|
|
|
|
archive_glue_dep,
|
|
|
|
output_glue_dep,
|
|
|
|
mixer_glue_dep,
|
|
|
|
decoder_glue_dep,
|
|
|
|
encoder_glue_dep,
|
|
|
|
playlist_glue_dep,
|
|
|
|
db_glue_dep,
|
|
|
|
storage_glue_dep,
|
|
|
|
song_dep,
|
|
|
|
systemd_dep,
|
|
|
|
sqlite_dep,
|
|
|
|
zeroconf_dep,
|
|
|
|
more_deps,
|
2019-04-05 12:38:49 +02:00
|
|
|
chromaprint_dep,
|
2021-05-19 18:58:18 +02:00
|
|
|
fmt_dep,
|
2017-12-29 17:12:55 +01:00
|
|
|
],
|
|
|
|
link_args: link_args,
|
2020-10-05 19:46:18 +02:00
|
|
|
build_by_default: not get_option('fuzzer'),
|
2024-01-18 19:33:16 +01:00
|
|
|
install : true,
|
|
|
|
install_dir: install_dir
|
2017-12-29 17:12:55 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
configure_file(output: 'config.h', configuration: conf)
|
|
|
|
|
|
|
|
if systemd_dep.found()
|
|
|
|
subdir('systemd')
|
|
|
|
endif
|
|
|
|
|
2024-01-18 19:33:16 +01:00
|
|
|
if not is_android
|
|
|
|
install_data(
|
|
|
|
'mpd.svg',
|
|
|
|
install_dir: join_paths(get_option('datadir'), 'icons', 'hicolor', 'scalable', 'apps'),
|
|
|
|
)
|
|
|
|
|
|
|
|
install_data(
|
|
|
|
'AUTHORS', 'COPYING', 'NEWS', 'README.md',
|
|
|
|
install_dir: join_paths(get_option('datadir'), 'doc', meson.project_name()),
|
|
|
|
)
|
|
|
|
endif
|
2018-10-26 15:54:14 +02:00
|
|
|
|
2020-08-14 12:35:29 +02:00
|
|
|
subdir('doc')
|
2017-12-29 17:12:55 +01:00
|
|
|
|
|
|
|
if get_option('test')
|
|
|
|
subdir('test')
|
|
|
|
endif
|
2020-10-05 19:46:18 +02:00
|
|
|
|
|
|
|
if get_option('fuzzer')
|
|
|
|
subdir('test/fuzzer')
|
|
|
|
endif
|