Skip to content

Commit aed3fc2

Browse files
committed
build: Do not use the configurator for meson
meson does the feature detection itself and we don't have to rely on the configurator. So don't use it. To avoid touching the ccan files, we have to rethink our config.h to libnvme-config.h rename change. Since the ccan files include 'config.h' we have to use the second option to avoid including it into external include paths. This is moving the config.h file into a private folder and drop the include path '.'. Signed-off-by: Daniel Wagner <[email protected]>
1 parent 7bbad82 commit aed3fc2

6 files changed

Lines changed: 13 additions & 30 deletions

File tree

ccan/meson.build

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,3 @@ sources += files([
1111
'ccan/str/debug.c',
1212
'ccan/str/str.c',
1313
])
14-
15-
configurator = executable(
16-
'configurator',
17-
['tools/configurator/configurator.c'],
18-
c_args: ['-D_GNU_SOURCE'],
19-
include_directories: incdir,
20-
)
21-
22-
config_h = custom_target(
23-
'config.h',
24-
output: 'config.h',
25-
capture: true,
26-
command: [configurator, ]
27-
)
28-
29-

examples/meson.build

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#
88
executable(
99
'telemetry-listen',
10-
['telemetry-listen.c', config_h],
10+
['telemetry-listen.c'],
1111
link_with: libnvme,
1212
include_directories: incdir)
1313

@@ -19,7 +19,7 @@ executable(
1919

2020
executable(
2121
'discover-loop',
22-
['discover-loop.c', config_h],
22+
['discover-loop.c'],
2323
link_with: libnvme,
2424
include_directories: incdir)
2525

libnvme/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ endif
1919
if have_python_support
2020
pymod_swig = custom_target(
2121
'nvme.py',
22-
input: ['nvme.i', config_h],
22+
input: ['nvme.i'],
2323
output: ['nvme.py', 'nvme_wrap.c'],
2424
command: [swig, '-python', '-py3', '-o', '@OUTPUT1@', '@INPUT0@'],
2525
install: true,

meson.build

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,6 @@ conf.set10(
120120
description: 'Is isblank() available?'
121121
)
122122

123-
configure_file(
124-
output: 'libnvme-config.h',
125-
configuration: conf
126-
)
127-
128123
################################################################################
129124
substs = configuration_data()
130125
substs.set('NAME', meson.project_name())
@@ -138,8 +133,8 @@ configure_file(
138133

139134
################################################################################
140135
add_project_arguments(['-fomit-frame-pointer', '-D_GNU_SOURCE',
141-
'-include', 'libnvme-config.h'], language : 'c')
142-
incdir = include_directories(['.', 'ccan', 'src'])
136+
'-include', 'config.h'], language : 'c')
137+
incdir = include_directories(['ccan', 'src'])
143138

144139
################################################################################
145140
sources = []

src/meson.build

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
#
66
# Authors: Martin Belanger <[email protected]>
77
#
8+
configure_file(
9+
output: 'config.h',
10+
configuration: conf
11+
)
12+
813
sources += [
914
'nvme/cleanup.c',
1015
'nvme/fabrics.c',
@@ -14,7 +19,6 @@ sources += [
1419
'nvme/log.c',
1520
'nvme/tree.c',
1621
'nvme/util.c',
17-
config_h,
1822
]
1923

2024
if conf.get('CONFIG_JSONC')

test/meson.build

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#
88
main = executable(
99
'main-test',
10-
['test.c', config_h],
10+
['test.c'],
1111
dependencies: libuuid,
1212
link_with: libnvme,
1313
include_directories: incdir
@@ -22,14 +22,14 @@ cpp = executable(
2222

2323
register = executable(
2424
'test-register',
25-
['register.c', config_h],
25+
['register.c'],
2626
link_with: libnvme,
2727
include_directories: incdir
2828
)
2929

3030
zns = executable(
3131
'test-zns',
32-
['zns.c', config_h],
32+
['zns.c'],
3333
link_with: libnvme,
3434
include_directories: incdir
3535
)

0 commit comments

Comments
 (0)