aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ext_depends/D-YAML/meson.build
blob: 6a33ed668db28dc1dcf5f7a6074393b92c77ef72 (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
project('D-YAML', 'd',
    meson_version: '>=0.40.0',
    version: '0.10.0'
)

project_soversion    = '0'

src_dir = include_directories('source/')
pkgc = import('pkgconfig')

d_compiler = meson.get_compiler('d')
global_d_args = []
if d_compiler.get_id() == 'gcc'
  global_d_args += ['-fall-instantiations']
endif

dyaml_src = [
    'source/dyaml/composer.d',
    'source/dyaml/constructor.d',
    'source/dyaml/dumper.d',
    'source/dyaml/emitter.d',
    'source/dyaml/encoding.d',
    'source/dyaml/escapes.d',
    'source/dyaml/event.d',
    'source/dyaml/exception.d',
    'source/dyaml/linebreak.d',
    'source/dyaml/loader.d',
    'source/dyaml/node.d',
    'source/dyaml/package.d',
    'source/dyaml/parser.d',
    'source/dyaml/queue.d',
    'source/dyaml/reader.d',
    'source/dyaml/representer.d',
    'source/dyaml/resolver.d',
    'source/dyaml/scanner.d',
    'source/dyaml/serializer.d',
    'source/dyaml/style.d',
    'source/dyaml/tagdirective.d',
    'source/dyaml/test/constructor.d',
    'source/dyaml/test/representer.d',
    'source/dyaml/test/suite.d',
    'source/dyaml/test/suitehelpers.d',
    'source/dyaml/token.d',
    'source/dyaml/stdsumtype.d'
]
install_subdir('source/dyaml', install_dir: 'include/d/yaml/')

tinyendian_dep = dependency('tinyendian', version: '>=0.2.0', fallback: ['tinyendian', 'tinyendian_dep'])

dyaml_lib = library('dyaml',
        [dyaml_src],
        include_directories: [src_dir],
        dependencies: [tinyendian_dep],
        install: true,
        version: meson.project_version(),
        d_args: global_d_args,
        soversion: project_soversion
)
pkgc.generate(name: 'dyaml',
              libraries: dyaml_lib,
              subdirs: 'd/yaml/',
              version: meson.project_version(),
              extra_cflags: global_d_args,
              description: 'YAML parser and emitter for the D programming language.'
)

# Make D-YAML easy to use as subproject
dyaml_dep = declare_dependency(
    link_with: dyaml_lib,
    include_directories: [src_dir],
    dependencies: [tinyendian_dep],
    compile_args: global_d_args,
)