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
if wasm_eval_only
  # Only the minimal subset needed by the WASM evaluator.
  # fetch-settings.cc: provides the fetchSettings global.
  # attrs.cc: provides jsonToAttrs / attrsToJSON.
  liblix_sources += files(
    'attrs.cc',
    'fetch-settings.cc',
  )
else
  liblix_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',
  )
endif

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

libfetchers_setting_definitions = files(
  'settings/accept-flake-config.md',
  'settings/access-tokens.md',
  'settings/allow-dirty.md',
  'settings/commit-lockfile-summary.md',
  'settings/flake-registry.md',
  'settings/use-registries.md',
  'settings/warn-dirty.md',
)
liblix_generated_headers += custom_target(
  command : [
    python.full_path(),
    '@SOURCE_ROOT@/lix/code-generation/build_settings.py',
    '--kernel', host_machine.system(),
    '--header', '@OUTPUT@',
    '--experimental-features', '@SOURCE_ROOT@/lix/libutil/experimental-features',
    '@INPUT@',
  ],
  input : libfetchers_setting_definitions,
  output : 'libfetchers-settings.gen.inc',
  install : true,
  install_dir : includedir / 'lix/libfetchers',
)

if not wasm_eval_only
  install_headers(libfetchers_headers, subdir : 'lix/libfetchers', preserve_path : true)
endif