--- a/meson.build +++ b/meson.build @@ -90,17 +90,7 @@ if system == 'linux' serd_dep = dependency('serd-0', version: '>= 0.5') capnp_dep = dependency('capnp', version: '>= 0.6') lrdf_dep = dependency('lrdf', version: '>= 0.2') - oggz_dep = dependency('oggz', version: '>= 1.0.0') - fishsound_dep = dependency('fishsound', version: '>= 1.0.0') - mad_dep = dependency('mad', version: '>= 0.15.0') - id3tag_dep = dependency('id3tag', version: '>= 0.15.0') - opus_dep = dependency('opusfile') - lo_dep = dependency('liblo') - jack_dep = dependency('jack', version: '>= 0.100') - libpulse_dep = dependency('libpulse', version: '>= 0.9') alsa_dep = dependency('alsa') - - portaudio_dep = dependency('portaudio-2.0', version: '>= 19', required: false) feature_dependencies = [ bzip2_dep, @@ -113,23 +103,8 @@ if system == 'linux' serd_dep, capnp_dep, lrdf_dep, - oggz_dep, - fishsound_dep, - mad_dep, - id3tag_dep, - opus_dep, - lo_dep, - portaudio_dep, - jack_dep, - libpulse_dep, alsa_dep, ] - - server_dependencies = [ - capnp_dep, - sord_dep, - dl_dep, - ] feature_defines = [ '-DHAVE_BZ2', @@ -142,26 +117,110 @@ if system == 'linux' '-DHAVE_SERD', '-DHAVE_CAPNP', '-DHAVE_LRDF', - '-DHAVE_OGGZ', - '-DHAVE_FISHSOUND', - '-DHAVE_MAD', - '-DHAVE_ID3TAG', - '-DHAVE_OPUS', - '-DHAVE_LIBLO', - '-DHAVE_JACK', '-DDYNAMIC_JACK', - '-DHAVE_LIBPULSE', '-D__LINUX_ALSASEQ__', '-D__LINUX_ALSA__' # for RtMidi ] - if portaudio_dep.found() + enable_id3tag = get_option('id3tag') + if enable_id3tag + id3tag_dep = dependency('id3tag', version: '>= 0.15.0') + feature_dependencies += [ + id3tag_dep, + ] + feature_defines += [ + '-DHAVE_ID3TAG', + ] + endif + + enable_jack = get_option('jack') + if enable_jack + jack_dep = dependency('jack', version: '>= 0.100') + feature_dependencies += [ + jack_dep, + ] + feature_defines += [ + '-DHAVE_JACK', + '-DDYNAMIC_JACK', + ] + endif + + enable_mad = get_option('mad') + if enable_mad + mad_dep = dependency('mad', version: '>= 0.15.0') + feature_dependencies += [ + mad_dep, + ] + feature_defines += [ + '-DHAVE_MAD', + ] + + svcore_moc_args = [ + '-DHAVE_MAD' + ] + endif + + enable_ogg = get_option('ogg') + if enable_ogg + oggz_dep = dependency('oggz', version: '>= 1.0.0') + fishsound_dep = dependency('fishsound', version: '>= 1.0.0') + feature_dependencies += [ + oggz_dep, + fishsound_dep, + ] + feature_defines += [ + '-DHAVE_OGGZ', + '-DHAVE_FISHSOUND', + ] + endif + + enable_opus = get_option('opus') + if enable_opus + opus_dep = dependency('opusfile') + feature_dependencies += [ + opus_dep, + ] + feature_defines += [ + '-DHAVE_OPUS', + ] + endif + + enable_osc = get_option('osc') + if enable_osc + lo_dep = dependency('liblo') + feature_dependencies += [ + lo_dep, + ] + feature_defines += [ + '-DHAVE_LIBLO', + ] + endif + + enable_portaudio = get_option('portaudio') + if enable_portaudio + portaudio_dep = dependency('portaudio-2.0', version: '>= 19', required: false) + feature_dependencies += [ + portaudio_dep, + ] feature_defines += [ '-DHAVE_PORTAUDIO', ] endif - svcore_moc_args = [ - '-DHAVE_MAD' + enable_pulseaudio = get_option('pulseaudio') + if enable_pulseaudio + libpulse_dep = dependency('libpulse', version: '>= 0.9') + feature_dependencies += [ + libpulse_dep, + ] + feature_defines += [ + '-DHAVE_LIBPULSE', + ] + endif + + server_dependencies = [ + capnp_dep, + sord_dep, + dl_dep, ] elif system == 'darwin' --- /dev/null +++ b/meson_options.txt @@ -0,0 +1,8 @@ +option('id3tag', type: 'boolean', value: false) +option('jack', type: 'boolean', value: false) +option('mad', type: 'boolean', value: false) +option('ogg', type: 'boolean', value: false) +option('opus', type: 'boolean', value: false) +option('osc', type: 'boolean', value: false) +option('portaudio', type: 'boolean', value: false) +option('pulseaudio', type: 'boolean', value: false)