forked from MusicPlayerDaemon/mpdscribble
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeson.build
144 lines (119 loc) · 3.22 KB
/
meson.build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
project('mpdscribble', 'cpp',
version: '0.23',
meson_version: '>= 0.47',
default_options: [
'cpp_std=c++14',
'warning_level=3',
],
license: 'GPLv2+',
)
cc = meson.get_compiler('cpp')
conf = configuration_data()
conf.set_quoted('PACKAGE', meson.project_name())
conf.set_quoted('VERSION', meson.project_version())
conf.set_quoted('FILE_CONF', join_paths(get_option('prefix'), get_option('sysconfdir'), 'mpdscribble.conf'))
if not get_option('syslog').disabled()
if cc.has_function('syslog')
conf.set('HAVE_SYSLOG', true)
elif get_option('syslog').enabled()
error('syslog() not found')
endif
endif
thread_dep = dependency('threads')
boost_dep = dependency('boost', version: '>= 1.62')
libmpdclient_dep = dependency('libmpdclient', version: '>= 2.5')
libgcrypt_dep = dependency('libgcrypt')
libcurl_dep = dependency('libcurl', version: '>= 7.18')
if host_machine.system() == 'linux'
libsystemd_dep = dependency('libsystemd', required: get_option('systemd'))
conf.set('HAVE_LIBSYSTEMD', libsystemd_dep.found())
else
libsystemd_dep = dependency('', required: false)
endif
common_cflags = [
# no header bloat for the iostream library we don't use
'-DBOOST_NO_IOSTREAM',
# avoid the runtime dependency on libboost_system
'-DBOOST_ERROR_CODE_HEADER_ONLY',
# disable deprecated boost::system features
'-DBOOST_SYSTEM_NO_DEPRECATED',
]
test_cflags = [
'-Wno-deprecated-declarations',
'-Wshadow',
'-Wpointer-arith',
'-Wcast-qual',
'-Wcast-align',
'-Wwrite-strings',
'-Wmissing-declarations', '-Wmissing-noreturn', '-Wmissing-format-attribute',
'-Wredundant-decls', '-Wundef',
'-Wno-missing-field-initializers',
'-Wno-non-virtual-dtor',
'-fvisibility=hidden',
]
test_ldflags = [
]
if get_option('buildtype') != 'debug'
test_cflags += [
'-ffunction-sections',
'-fdata-sections',
]
test_ldflags += [
'-Wl,--gc-sections',
]
endif
add_global_arguments(common_cflags, language: 'cpp')
add_global_arguments(cc.get_supported_arguments(test_cflags), language: 'cpp')
add_global_link_arguments(cc.get_supported_link_arguments(test_ldflags), language: 'cpp')
configure_file(output: 'config.h', configuration: conf)
inc = include_directories(
'src',
# for the generated config.h
'.',
)
executable(
'mpdscribble',
'src/Main.cxx',
'src/Instance.cxx',
'src/Daemon.cxx',
'src/Protocol.cxx',
'src/Scrobbler.cxx',
'src/MultiScrobbler.cxx',
'src/Form.cxx',
'src/CommandLine.cxx',
'src/ReadConfig.cxx',
'src/IniFile.cxx',
'src/Journal.cxx',
'src/MpdObserver.cxx',
'src/Log.cxx',
'src/lib/curl/Init.cxx',
'src/lib/curl/Global.cxx',
'src/lib/curl/Request.cxx',
'src/lib/curl/Escape.cxx',
'src/util/Exception.cxx',
'src/util/OptionParser.cxx',
'src/util/PrintException.cxx',
'src/util/StringStrip.cxx',
'src/util/StringView.cxx',
include_directories: inc,
dependencies: [
thread_dep,
boost_dep,
libmpdclient_dep,
libgcrypt_dep,
libcurl_dep,
libsystemd_dep,
],
install: true
)
install_data(
'AUTHORS', 'COPYING', 'NEWS', 'README.rst',
install_dir: join_paths(get_option('datadir'), 'doc', meson.project_name()),
)
if libsystemd_dep.found()
subdir('systemd')
endif
subdir('doc')
if get_option('test')
subdir('test')
endif