Browse Source

use features instead of booleans for optional dependencies

cairo_optimizations
Alexandros Theodotou 3 years ago
parent
commit
2f6ca072f0
Signed by: alex
GPG Key ID: 022EAE42313D70F3
  1. 2
      .builds/archlinux.yml
  2. 2
      .builds/debian.yml
  3. 2
      .builds/ubuntu.yml
  4. 8
      .travis.yml
  5. 12
      data/meson.build
  6. 2
      doc/user/meson.build
  7. 229
      meson.build
  8. 52
      meson_options.txt
  9. 6
      src/guile/meson.build
  10. 2
      src/meson.build

2
.builds/archlinux.yml

@ -35,7 +35,7 @@ secrets: @@ -35,7 +35,7 @@ secrets:
tasks:
- setup: |
cd zrythm
../meson/meson.py build -Denable_tests=true -Dmanpage=true -Denable_ffmpeg=true -Db_coverage=true
../meson/meson.py build -Denable_tests=true -Dmanpage=true -Dffmpeg=enabled -Db_coverage=true
- build: |
cd zrythm
ninja -C build

2
.builds/debian.yml

@ -32,7 +32,7 @@ sources: @@ -32,7 +32,7 @@ sources:
tasks:
- setup: |
cd zrythm
../meson/meson.py build -Denable_tests=true -Dmanpage=true -Denable_ffmpeg=true
../meson/meson.py build -Denable_tests=true -Dmanpage=true -Dffmpeg=enabled
- build: |
cd zrythm
ninja -C build

2
.builds/ubuntu.yml

@ -32,7 +32,7 @@ sources: @@ -32,7 +32,7 @@ sources:
tasks:
- setup: |
cd zrythm
../meson/meson.py build -Denable_tests=true -Dmanpage=true -Denable_ffmpeg=true
../meson/meson.py build -Denable_tests=true -Dmanpage=true -Dffmpeg=enabled
- build: |
cd zrythm
ninja -C build

8
.travis.yml

@ -64,7 +64,7 @@ script: @@ -64,7 +64,7 @@ script:
set -e
case $TRAVIS_OS_NAME in
osx)
meson build -Denable_sdl=true -Denable_rtaudio=true -Denable_rtmidi=true -Denable_tests=true -Denable_jack=false
meson build -Dsdl=enabled -Drtaudio=auto -Drtmidi=auto -Denable_tests=true
ninja -C build
ninja -C build test
sudo ninja -C build install
@ -73,11 +73,7 @@ script: @@ -73,11 +73,7 @@ script:
# hack to enable tests
$mingw64 sed -i -e '27s/false/true/' meson_options.txt
# hack to enable sdl
$mingw64 sed -i -e '63s/false/true/' meson_options.txt
# hack to disable jack
$mingw64 sed -i -e '75s/true/false/' meson_options.txt
# hack to disable guile
$mingw64 sed -i -e '87s/true/false/' meson_options.txt
$mingw64 sed -i -e '63s/disabled/enabled/' meson_options.txt
$mingw64 meson build
$mingw64 ninja -C build
$mingw64 ninja -C build test

12
data/meson.build

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
# Copyright (C) 2019 Alexandros Theodotou <alex at zrythm dot org>
# Copyright (C) 2019-2020 Alexandros Theodotou <alex at zrythm dot org>
#
# This file is part of Zrythm
#
@ -97,12 +97,10 @@ if not os_windows @@ -97,12 +97,10 @@ if not os_windows
endif
# GtkSourceView styles
if get_option ('enable_guile')
install_data (
'gtksourceview-monokai-extended.xml',
install_dir: sourceviewstylesdir,
rename: 'monokai-extended-zrythm.xml')
endif
install_data (
'gtksourceview-monokai-extended.xml',
install_dir: sourceviewstylesdir,
rename: 'monokai-extended-zrythm.xml')
# theme
install_data (

2
doc/user/meson.build

@ -58,7 +58,7 @@ endif @@ -58,7 +58,7 @@ endif
# generate guile docs
guile_docs = []
if get_option ('enable_guile') and get_option ('guile_snarf_docs_path') != ''
if guile_dep.found () and get_option ('guile_snarf_docs_path') != ''
foreach snarfable_src : guile_snarfable_srcs
split_by_dot = snarfable_src.split('.')
without_ext = ''

229
meson.build

@ -210,9 +210,11 @@ check_functions = [ @@ -210,9 +210,11 @@ check_functions = [
jack_dep = dependency (
'jack', required: false, version: '<1.0')
if not jack_dep.found ()
jack_dep = dependency ('jack', required: false)
jack_dep = dependency (
'jack',
required: get_option ('jack'))
endif
if (not get_option ('enable_jack').disabled ()) and jack_dep.found ()
if jack_dep.found ()
cdata.set('HAVE_JACK', 1)
check_functions += [
['jack_set_property',[jack_dep]],
@ -436,51 +438,50 @@ else @@ -436,51 +438,50 @@ else
cdata.set('HAVE_GTK_SOURCE_VIEW_3', 1)
endif
# TODO add Cantarell font as dependency
zrythm_deps = [
jack_dep,
gtk_dep,
sndfile_dep,
libgtop_dep,
alsa_dep,
cyaml_dep,
audec_dep,
dependency('threads'),
lilv_dep,
dependency(
'sratom-0',
fallback: ['lilv', 'sratom_dep']),
dependency(
'serd-0',
fallback: ['lilv', 'serd_dep']),
dependency(
'sord-0',
fallback: ['lilv', 'sord_dep']),
dependency('samplerate', version: '>=0.1.8'),
dependency('rubberband'),
dependency ('libpcre'),
cc.find_library('dl'),
lv2_dep,
chromaprint_dep,
fftw3_dep,
gtksource_dep,
libcgraph_dep = dependency (
'libcgraph',
required: get_option ('graphviz'))
libgvc_dep = dependency (
'libgvc',
required: get_option ('graphviz'))
if libcgraph_dep.found () and libgvc_dep.found ()
cdata.set('HAVE_CGRAPH', 1)
endif
# these are needed for gentoo
dependency('fftw3_threads', required: false),
dependency('fftw3f_threads', required: false),
guile_dep = dependency (
'guile-3.0', required: false)
if not guile_dep.found ()
guile_dep = dependency (
'guile-2.2',
required: get_option ('guile'))
endif
if (guile_dep.found ())
cdata.set('HAVE_GUILE', 1)
endif
libm,
]
libavcodec_dep = dependency (
'libavcodec',
required: get_option ('ffmpeg'))
libavformat_dep = dependency (
'libavformat',
required: get_option ('ffmpeg'))
libavutil_dep = dependency (
'libavformat',
required: get_option ('ffmpeg'))
if libavcodec_dep.found () and libavformat_dep.found () and libavutil_dep.found ()
cdata.set('HAVE_FFMPEG', 1)
endif
if (get_option('enable_carla'))
cdata.set('HAVE_CARLA', 1)
carla_native_plugin_dep = dependency (
'carla-native-plugin', version: '>=2.1.0')
carla_standalone_dep = dependency (
'carla-standalone', version: '>=2.1.0')
carla_utils_dep = dependency (
'carla-utils', version: '>=2.1.0')
carla_native_plugin_dep = dependency (
'carla-native-plugin', version: '>=2.1.0',
required: get_option ('carla'))
carla_standalone_dep = dependency (
'carla-standalone', version: '>=2.1.0',
required: get_option ('carla'))
carla_utils_dep = dependency (
'carla-utils', version: '>=2.1.0',
required: get_option ('carla'))
if (carla_native_plugin_dep.found () and carla_standalone_dep.found () and carla_utils_dep.found ())
carla_libdir = carla_native_plugin_dep.get_pkgconfig_variable('libdir')
install_data (
find_program (
@ -488,7 +489,8 @@ if (get_option('enable_carla')) @@ -488,7 +489,8 @@ if (get_option('enable_carla'))
carla_libdir /
'carla-discovery-native').path(),
install_dir: bindir)
# discovery & bridge for 32-bit vst's
cdata.set('HAVE_CARLA', 1)
# discovery & bridge for 32-bit vst's
if os_windows
install_data (
find_program (
@ -501,68 +503,93 @@ if (get_option('enable_carla')) @@ -501,68 +503,93 @@ if (get_option('enable_carla'))
'carla-bridge-win32.exe').path(),
install_dir: bindir)
endif
zrythm_deps += [
carla_native_plugin_dep,
carla_standalone_dep,
carla_utils_dep, ]
endif
if (get_option('enable_ffmpeg'))
zrythm_deps += dependency('libavcodec')
zrythm_deps += dependency('libavformat')
zrythm_deps += dependency('libavutil')
cdata.set('HAVE_FFMPEG', 1)
endif
if (get_option ('enable_graphviz'))
zrythm_deps += dependency ('libcgraph')
zrythm_deps += dependency ('libgvc')
cdata.set('HAVE_CGRAPH', 1)
endif
if (get_option('enable_portaudio'))
zrythm_deps += dependency ('portaudio-2.0')
portaudio_dep = dependency (
# disable until it works
#cdata.set('HAVE_PORT_AUDIO', 1)
'portaudio-2.0-dont-use-yet',
required: get_option ('portaudio'))
if portaudio_dep.found ()
cdata.set('HAVE_PORT_AUDIO', 1)
endif
if (get_option('enable_rtmidi'))
rtmidi_dep = dependency ('rtmidi', required: false)
if not rtmidi_dep.found()
rtmidi_proj = subproject('rtmidi')
rtmidi_dep = rtmidi_proj.get_variable(
'zrythm_rtmidi_dep')
endif
zrythm_deps += rtmidi_dep
rtmidi_dep = dependency (
'rtmidi', required: get_option ('rtmidi'))
if not rtmidi_dep.found () and not get_option ('rtmidi').disabled ()
rtmidi_proj = subproject('rtmidi')
rtmidi_dep = rtmidi_proj.get_variable(
'zrythm_rtmidi_dep')
endif
if rtmidi_dep.found ()
cdata.set('HAVE_RTMIDI', 1)
endif
if (get_option('enable_rtaudio'))
rtaudio_dep = dependency (
'rtaudio', required: false)
if not rtaudio_dep.found()
rtaudio_proj = subproject('rtaudio')
rtaudio_dep = rtaudio_proj.get_variable(
'zrythm_rtaudio_dep')
endif
zrythm_deps += rtaudio_dep
rtaudio_dep = dependency (
'rtaudio', required: get_option ('rtaudio'))
if not rtaudio_dep.found() and not get_option ('rtaudio').disabled ()
rtaudio_proj = subproject('rtaudio')
rtaudio_dep = rtaudio_proj.get_variable(
'zrythm_rtaudio_dep')
endif
if rtaudio_dep.found ()
cdata.set('HAVE_RTAUDIO', 1)
endif
if (get_option('enable_sdl'))
zrythm_deps += dependency ('sdl2')
sdl_dep = dependency (
'sdl2', required: get_option ('sdl'))
if sdl_dep.found ()
cdata.set('HAVE_SDL', 1)
endif
if get_option('enable_guile')
guile_dep = dependency (
'guile-3.0', required: false)
if not guile_dep.found ()
guile_dep = dependency ('guile-2.2')
endif
zrythm_deps += guile_dep
cdata.set('HAVE_GUILE', 1)
endif
# TODO add Cantarell font as dependency
zrythm_deps = [
jack_dep,
gtk_dep,
sndfile_dep,
libgtop_dep,
alsa_dep,
cyaml_dep,
audec_dep,
libcgraph_dep,
libgvc_dep,
guile_dep,
libavcodec_dep,
libavformat_dep,
libavutil_dep,
carla_native_plugin_dep,
carla_standalone_dep,
carla_utils_dep,
portaudio_dep,
rtaudio_dep,
rtmidi_dep,
sdl_dep,
dependency('threads'),
lilv_dep,
dependency(
'sratom-0',
fallback: ['lilv', 'sratom_dep']),
dependency(
'serd-0',
fallback: ['lilv', 'serd_dep']),
dependency(
'sord-0',
fallback: ['lilv', 'sord_dep']),
dependency('samplerate', version: '>=0.1.8'),
dependency('rubberband'),
dependency ('libpcre'),
cc.find_library('dl'),
lv2_dep,
chromaprint_dep,
fftw3_dep,
gtksource_dep,
# these are needed for gentoo
dependency('fftw3_threads', required: false),
dependency('fftw3f_threads', required: false),
libm,
]
if os_windows
zrythm_deps += cc.find_library('dbghelp')
@ -660,15 +687,15 @@ summary({ @@ -660,15 +687,15 @@ summary({
}, section: 'General')
summary({
'FFmpeg': get_option('enable_ffmpeg'),
'Jack': not get_option('enable_jack').disabled(),
'PortAudio': get_option('enable_portaudio'),
'RtMidi': get_option('enable_rtmidi'),
'RtAudio': get_option('enable_rtaudio'),
'SDL': get_option('enable_sdl'),
'Carla': get_option('enable_carla'),
'FFmpeg': libavcodec_dep.found () and libavformat_dep.found () and libavutil_dep.found (),
'Jack': jack_dep.found (),
'PortAudio': portaudio_dep.found (),
'RtMidi': rtmidi_dep.found (),
'RtAudio': rtaudio_dep.found (),
'SDL': sdl_dep.found (),
'Carla': carla_native_plugin_dep.found () and carla_standalone_dep.found () and carla_utils_dep.found (),
'Gtop': libgtop_dep.found(),
'Guile': get_option('enable_guile'),
'Guile': guile_dep. found(),
}, section: 'Optional libraries')
summary({

52
meson_options.txt

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
# Copyright (C) 2019 Alexandros Theodotou <alex at zrythm dot org>
# Copyright (C) 2019-2020 Alexandros Theodotou <alex at zrythm dot org>
#
# This file is part of Zrythm
#
@ -34,57 +34,57 @@ option ( @@ -34,57 +34,57 @@ option (
description: 'Whether to compile GUI unit tests')
option (
'enable_ffmpeg',
type: 'boolean',
value: false,
'ffmpeg',
type: 'feature',
value: 'disabled',
description: 'Compile with ffmpeg (for MP3 support)')
option (
'enable_portaudio',
type: 'boolean',
value: false,
'portaudio',
type: 'feature',
value: 'disabled',
description: 'Compile with portaudio support')
option (
'enable_rtmidi',
type: 'boolean',
value: false,
'rtmidi',
type: 'feature',
value: 'disabled',
description: 'Compile with RtMidi support')
option (
'enable_rtaudio',
type: 'boolean',
value: false,
'rtaudio',
type: 'feature',
value: 'disabled',
description: 'Compile with RtAudio support')
option (
'enable_sdl',
type: 'boolean',
value: false,
'sdl',
type: 'feature',
value: 'disabled',
description: 'Compile with SDL2 backend support')
option (
'enable_carla',
type: 'boolean',
value: false,
'carla',
type: 'feature',
value: 'disabled',
description: 'Use Carla to wrap some plugins')
option (
'enable_jack',
'jack',
type: 'feature',
value: 'auto',
description: 'Compile with JACK support')
option (
'enable_graphviz',
type: 'boolean',
value: true,
'graphviz',
type: 'feature',
value: 'auto',
description: 'Compile with GraphViz support (for exporting graphs)')
option (
'enable_guile',
type: 'boolean',
value: true,
'guile',
type: 'feature',
value: 'auto',
description: 'Build with libguile support for scripting')
option (

6
src/guile/meson.build

@ -33,9 +33,9 @@ guile_srcs = [ @@ -33,9 +33,9 @@ guile_srcs = [
guile_snarfable_srcs,
]
if get_option ('enable_guile')
if guile_snarf.found()
# .x files
if guile_dep.found ()
if guile_snarf.found ()
# .x files
guile_snarfed_srcs = []
foreach snarfable_src : guile_snarfable_srcs
split_by_dot = snarfable_src.split('.')

2
src/meson.build

@ -39,7 +39,7 @@ zrythm_link_libs = [ @@ -39,7 +39,7 @@ zrythm_link_libs = [
midilib,
]
if get_option ('enable_guile')
if guile_dep.found ()
zrythm_link_libs += guilelib
endif

Loading…
Cancel
Save