summaryrefslogtreecommitdiff
path: root/src/cache/meson.build
blob: 816b101af3cb01b9e90477bf8d98082d28b7d795 (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
cache_src = [
  'entry.c',
  'handle.c',
  'threaded_waits.c',
  'backings/memory.c'
]
cache_deps = []
cache_args = []

if 'file' in get_option('sources')
  if naunet_has_mmap
    cache_src += ['backings/file_mapped.c']
  else
    cache_src += ['backings/file.c']
  endif
  cache_src += ['handlers/file.c']
  cache_args += ['-DCACHE_HAVE_FILE']
endif

if 'http' in get_option('sources') and naunet_has_curl
  cache_src += ['handlers/http.c']
endif

if 'cdio' in get_option('sources')
  libcdio_paranoia = dependency('libcdio_paranoia', allow_fallback: true)
  libcdio_cdda = dependency('libcdio_cdda', allow_fallback: true)
  if libcdio_paranoia.found() and libcdio_cdda.found()
    cache_src += ['handlers/cdio.c']
    cache_deps += [libcdio_paranoia, libcdio_cdda]
    cache_args += ['-DCACHE_HAVE_CDIO']
  endif
endif

if 'libdvd' in get_option('sources')
  libdvdcss = dependency('libdvdcss', allow_fallback: true)
  libdvdread = dependency('dvdread', allow_fallback: true)
  libdvdnav = dependency('dvdnav', allow_fallback: true)
  if libdvdcss.found() and libdvdread.found() and libdvdnav.found()
    cache_deps += [libdvdcss, libdvdread, libdvdnav]
    cache_args += ['-DCACHE_HAVE_LIBDVD']
  endif
endif

cache = declare_dependency(sources: cache_src, dependencies: cache_deps, compile_args: cache_args)