summaryrefslogtreecommitdiffstats
path: root/src/meson.build
blob: b573b1955cb122d98371ea2285c7e8645dde6526 (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
# SPDX-License-Identifier: LGPL-2.1-or-later
#
# This file is part of libnvme.
# Copyright (c) 2021 Dell Inc.
#
# Authors: Martin Belanger <Martin.Belanger@dell.com>
#
sources = [
    'nvme/cleanup.c',
    'nvme/fabrics.c',
    'nvme/filters.c',
    'nvme/ioctl.c',
    'nvme/linux.c',
    'nvme/log.c',
    'nvme/tree.c',
    'nvme/util.c',
]

if conf.get('CONFIG_JSONC')
    sources += 'nvme/json.c'
endif

deps = [
    libuuid_dep,
    json_c_dep,
    openssl_dep,
]

source_dir = meson.current_source_dir()
mapfile = 'libnvme.map'
version_script_arg = join_paths(source_dir, mapfile)

libnvme = library(
    'nvme', # produces libnvme.so
    sources,
    version: library_version,
    link_args: ['-Wl,--version-script=' + version_script_arg],
    dependencies: deps,
    link_depends: mapfile,
    include_directories: [incdir, internal_incdir],
    install: true,
    link_with: libccan,
)

pkg = import('pkgconfig')
pkg.generate(libnvme,
    filebase: meson.project_name(),
    name: meson.project_name(),
    version: meson.project_version(),
    description: 'Manage "libnvme" subsystem devices (Non-volatile Memory Express)',
    url: 'http://github.com/linux-nvme/libnvme/',
)

libnvme_dep = declare_dependency(
    include_directories: ['.'],
    dependencies: deps,
    link_with: libnvme,
)

mode = ['rw-r--r--', 0, 0]
install_headers('libnvme.h', install_mode: mode)
install_headers([
        'nvme/fabrics.h',
        'nvme/filters.h',
        'nvme/ioctl.h',
        'nvme/linux.h',
        'nvme/log.h',
        'nvme/tree.h',
        'nvme/types.h',
        'nvme/util.h',
    ],
    subdir: 'nvme',
    install_mode: mode,
)