project('camu', ['c', 'cpp'], # Marking cpp here is required for subproject cross-builds. version: '0.01', meson_version: '>=0.63.0', # Wrap diff_files (0.63.0). default_options: ['warning_level=2', 'c_std=c99'], license: 'GPL-3.0-only') # Fail early if 'Compiler for build machine not found'. add_languages('c', 'cpp', native: true) compiler = meson.get_compiler('c') is_debug = get_option('debug') is_minsize = get_option('optimization') == 's' 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'] 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')] window = get_option('window') if window == 'auto' if is_windows window = 'win32' elif is_android window = 'glfm' else 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 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] subdir('src/cache') subdir('src/codec') subdir('src/liana') if get_option('portal').enabled() subdir('src/portal') endif if need_server subdir('src/server') endif if need_client subdir('src/libclient') endif if need_sink subdir('src/buffer') subdir('src/mixer') if not no_video subdir('src/render') subdir('src/screen') endif subdir('src/libsink') endif if get_option('fruits') != [] subdir('src/fruits') endif if get_option('tests').allowed() and not meson.is_subproject() subdir('tests') endif