summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build91
1 files changed, 71 insertions, 20 deletions
diff --git a/meson.build b/meson.build
index e817842..2126ef2 100644
--- a/meson.build
+++ b/meson.build
@@ -8,7 +8,6 @@ project('camu', ['c', 'cpp'], # Marking cpp here is required for subproject cros
add_languages('c', 'cpp', native: true)
compiler = meson.get_compiler('c')
-cmake = import('cmake')
is_debug = get_option('debug')
is_minsize = get_option('optimization') == 's'
@@ -16,33 +15,85 @@ is_linux = host_machine.system() == 'linux'
is_windows = host_machine.system() == 'windows'
is_msvc = compiler.get_id() == 'msvc' or compiler.get_id() == 'clang-cl'
is_android = host_machine.system() == 'android'
+is_static_shared_lib = is_android
+
+cmake = import('cmake')
+cmake_reltype = is_minsize ? 'MinSizeRel' : 'Release'
+
+need_server = get_option('server').enabled()
+need_client = get_option('client').enabled()
+need_sink = get_option('sink').enabled()
+no_video = get_option('sink-no-video')
+if 'cmsrv' in get_option('fruits')
+ if get_option('server').disabled()
+ error('cmsrv requires the server component.')
+ endif
+ need_server = true
+endif
+if 'cmc' in get_option('fruits')
+ if get_option('client').disabled()
+ error('cmc requires the client component.')
+ endif
+ need_client = true
+endif
+if 'cmv' in get_option('fruits')
+ if get_option('sink').disabled()
+ error('cmv requires the sink component.')
+ endif
+ if not get_option('sink-only')
+ if get_option('server').disabled()
+ error('cmv requires the server component unless in a sink-only configuration.')
+ endif
+ need_server = true
+ endif
+ need_sink = true
+endif
alabaster = subproject('libalabaster')
naunet_opts = []
+if need_server and 'http' in get_option('sources')
+ naunet_opts += ['curl=enabled']
+endif
if get_option('portal').enabled()
- naunet_opts += ['json=enabled', 'curl=enabled']
+ naunet_opts += ['json=enabled']
endif
naunet = subproject('libnaunet', default_options: naunet_opts)
naunet_has_curl = naunet.get_variable('naunet_has_curl')
naunet_has_mmap = naunet.get_variable('naunet_has_mmap')
common_deps = [alabaster.get_variable('alabaster'), naunet.get_variable('naunet')]
-no_video = meson.is_subproject()
-# @TODO: Does it make sense for stela to be a dependency for server-side (headless) transcode.
-#if not no_video
- stela_opts = ['poll=inline', 'event-buffer=false', 'pause=true', 'window=' + get_option('window')]
- if get_option('renderer-api') == 'vulkan'
- stela_opts += ['api=vulkan']
- elif get_option('renderer-api') == 'dx11'
- stela_opts += ['api=dx11']
+window = get_option('window')
+if window == 'auto'
+ if is_windows
+ window = 'win32'
+ elif is_android
+ window = 'glfm'
else
- stela_opts += [is_android ? 'api=gles' : 'api=gl']
- if get_option('renderer-api') == 'gl-rpi'
- stela_opts += ['egl-brcm=true']
- endif
+ window = 'wayland'
+ endif
+endif
+renderer_api = get_option('renderer-api')
+if renderer_api == 'auto'
+ if is_windows
+ renderer_api = 'dx11'
+ elif is_android
+ renderer_api = 'gl'
+ else
+ renderer_api = 'vulkan'
endif
- stela = subproject('stela', default_options: stela_opts).get_variable('stela')
-#endif
+endif
+stela_opts = ['poll=inline', 'event-buffer=false', 'pause=true', 'window=' + window]
+if renderer_api == 'vulkan'
+ stela_opts += ['api=vulkan']
+elif renderer_api == 'dx11'
+ stela_opts += ['api=dx11']
+elif renderer_api in ['gl', 'gl-rpi']
+ stela_opts += [is_android ? 'api=gles' : 'api=gl']
+ if renderer_api == 'gl-rpi'
+ stela_opts += ['egl-brcm=true']
+ endif
+endif
+stela = subproject('stela', default_options: stela_opts).get_variable('stela')
subdir('src/util')
common_deps += [util]
@@ -55,15 +106,15 @@ if get_option('portal').enabled()
subdir('src/portal')
endif
-if get_option('server').enabled()
+if need_server
subdir('src/server')
endif
-if get_option('client').enabled()
+if need_client
subdir('src/libclient')
endif
-if get_option('sink').enabled()
+if need_sink
subdir('src/buffer')
subdir('src/mixer')
if not no_video
@@ -73,7 +124,7 @@ if get_option('sink').enabled()
subdir('src/libsink')
endif
-if not meson.is_subproject()
+if get_option('fruits') != []
subdir('src/fruits')
endif