aboutsummaryrefslogtreecommitdiff
path: root/src/libfetchers/meson.build
blob: b66d0b9f9e8f0451e01a936b21785ef3607b0a0f (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
libfetchers_sources = files(
  'attrs.cc',
  'cache.cc',
  'fetch-settings.cc',
  'fetch-to-store.cc',
  'fetchers.cc',
  'git.cc',
  'github.cc',
  'indirect.cc',
  'mercurial.cc',
  'path.cc',
  'registry.cc',
  'tarball.cc',
)

libfetchers_headers = files(
  'attrs.hh',
  'cache.hh',
  'fetch-settings.hh',
  'fetch-to-store.hh',
  'fetchers.hh',
  'registry.hh',
)

libfetchers = library(
  'lixfetchers',
  libfetchers_sources,
  dependencies : [
    liblixstore,
    liblixutil,
    nlohmann_json,
  ],
  cpp_pch : cpp_pch,
  install : true,
  # FIXME(Qyriad): is this right?
  install_rpath : libdir,
)

install_headers(libfetchers_headers, subdir : 'lix/libfetchers', preserve_path : true)

# FIXME: not using the pkg-config module because it creates way too many deps
# while meson migration is in progress, and we want to not include boost here
configure_file(
  input : 'lix-fetchers.pc.in',
  output : 'lix-fetchers.pc',
  install_dir : libdir / 'pkgconfig',
  configuration : {
    'prefix' : prefix,
    'libdir' : libdir,
    'includedir' : includedir,
    'PACKAGE_VERSION' : meson.project_version(),
  },
)

liblixfetchers = declare_dependency(
  include_directories : include_directories('.'),
  link_with : libfetchers,
)

# FIXME: remove when https://git.lix.systems/lix-project/lix/issues/359 is fixed.
if is_static
  liblixfetchers_mstatic = declare_dependency(
    include_directories : include_directories('.'),
    link_whole : libfetchers,
  )
else
  liblixfetchers_mstatic = liblixfetchers
endif