summaryrefslogtreecommitdiff
path: root/meson.build
blob: 6eda9b8801a8682d87daa11f962996c7e77e4627 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
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', native: true)
add_languages('cpp', native: true)

compiler = meson.get_compiler('c')
cmake = import('cmake')

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'

alabaster = subproject('libalabaster')
naunet_opts = []
if get_option('portal').enabled()
  naunet_opts += ['json=enabled', 'curl=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']
  else
    stela_opts += [is_android ? 'api=gles' : 'api=gl']
    if get_option('renderer-api') == 'gl-rpi'
      stela_opts += ['egl-brcm=true']
    endif
  endif
  stela = subproject('stela', default_options: stela_opts).get_variable('stela')
#endif

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 get_option('server').enabled()
  subdir('src/server')
endif

if get_option('client').enabled()
  subdir('src/libclient')
endif

if get_option('sink').enabled()
  subdir('src/buffer')
  subdir('src/mixer')
  if not no_video
    subdir('src/render')
    subdir('src/screen')
  endif
  subdir('src/libsink')
endif

if not meson.is_subproject()
  subdir('src/fruits')
endif

if get_option('tests').allowed() and not meson.is_subproject()
  subdir('tests')
endif