Skip to content

Commit 91ad60a

Browse files
dvzrvfalkTX
authored andcommitted
Add logic to optionally compile jack_transport with readline support
meson.build: Analoguous to the other feature options, define whether readline support is selected. tools/meson.build: Only optionally compile `jack_transport` with readline support if the requirements are met.
1 parent f65f4a2 commit 91ad60a

2 files changed

Lines changed: 16 additions & 3 deletions

File tree

meson.build

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jack_version = dep_jack.version()
2727
lib_jackserver = cc.find_library('jackserver', required: true)
2828
lib_jacknet = cc.find_library('jacknet', required: get_option('jack_net'))
2929
dep_opus = dependency('opus', version: '>=0.9.0', required: get_option('opus_support'))
30-
dep_readline = dependency('readline')
30+
dep_readline = dependency('readline', required: get_option('readline_support'))
3131
dep_samplerate = dependency('samplerate', required: libsamplerate_required)
3232
dep_sndfile = dependency('sndfile', required: get_option('jack_rec'))
3333
dep_threads = dependency('threads')
@@ -56,6 +56,11 @@ if get_option('opus_support').enabled() or (get_option('opus_support').auto() an
5656
opus_support = true
5757
endif
5858

59+
readline_support = false
60+
if get_option('readline_support').enabled() or (get_option('readline_support').auto() and dep_readline.found())
61+
readline_support = true
62+
endif
63+
5964
build_jack_rec = false
6065
if get_option('jack_rec').enabled() or (get_option('jack_rec').auto() and dep_sndfile.found())
6166
build_jack_rec = true
@@ -76,6 +81,7 @@ if build_jack_netsource
7681
message('Build jack_netsource with opus support: ' + opus_support.to_string())
7782
endif
7883
message('Build jack_rec executable: ' + build_jack_rec.to_string())
84+
message('Build jack_transport with readline support: ' + readline_support.to_string())
7985
message('Build ZALSA internal clients: ' + build_zalsa.to_string())
8086

8187
conf_data = configuration_data()

tools/meson.build

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,18 @@ exe_jack_session_notify = executable(
156156
install: false
157157
)
158158

159+
jack_transport_c_args = c_args_common
160+
jack_transport_deps = [dep_jack]
161+
if readline_support
162+
jack_transport_c_args += ['-DHAVE_READLINE']
163+
jack_transport_deps += [dep_readline]
164+
endif
165+
159166
exe_jack_transport = executable(
160167
'jack_transport',
161-
c_args: c_args_common + ['-DHAVE_READLINE'],
168+
c_args: jack_transport_c_args,
162169
sources: ['transport.c'],
163-
dependencies: [dep_jack, dep_readline],
170+
dependencies: jack_transport_deps,
164171
install: true
165172
)
166173

0 commit comments

Comments
 (0)