File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,10 +21,4 @@ config_dep = declare_dependency(
2121 sources : config_h)
2222
2323config_h_path = meson .current_build_dir() / ' config.h'
24-
25- add_project_arguments (
26- [
27- ' -include' , config_h_path,
28- ],
29- language : ' c' ,
30- )
24+ config_h_arg = [ ' -include' , config_h_path ]
Original file line number Diff line number Diff line change @@ -230,16 +230,6 @@ conf.set(
230230 ),
231231 description : ' Is network address and service translation available'
232232)
233- conf.set(
234- ' HAVE_GLIBC_IOCTL' ,
235- cc.compiles(
236- ''' #include <sys/ioctl.h>
237- int ioctl(int fd, unsigned long request, ...);
238- ''' ,
239- name : ' ioctl has glibc-style prototype'
240- ),
241- description : ' Is ioctl the glibc interface (rather than POSIX)'
242- )
243233dl_dep = dependency (' dl' , required : false )
244234conf.set(
245235 ' HAVE_LIBC_DLSYM' ,
Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ libnvme = library(
5555 link_args : [' -Wl,--version-script=' + version_script_arg],
5656 dependencies : deps,
5757 link_depends : mapfile,
58+ c_args : config_h_arg,
5859 include_directories : [incdir, internal_incdir],
5960 install : true ,
6061 link_with : libccan,
@@ -81,6 +82,7 @@ libnvme_mi = library(
8182 ' nvme-mi' , # produces libnvme-mi.so
8283 mi_sources,
8384 version : library_version,
85+ c_args : config_h_arg,
8486 link_args : [' -Wl,--version-script=' + mi_version_script_arg],
8587 dependencies : mi_deps,
8688 link_depends : mi_mapfile,
@@ -100,6 +102,7 @@ libnvme_mi_test = library(
100102 ' nvme-mi-test' , # produces libnvme-mi-test.so
101103 mi_sources,
102104 dependencies : mi_deps,
105+ c_args : config_h_arg,
103106 include_directories : [incdir, internal_incdir],
104107 install : false ,
105108 link_with : libccan,
Original file line number Diff line number Diff line change 1+ mock_conf = configuration_data ()
2+
3+ mock_conf.set(
4+ ' HAVE_GLIBC_IOCTL' ,
5+ cc.compiles(
6+ ''' #include <sys/ioctl.h>
7+ int ioctl(int fd, unsigned long request, ...);
8+ ''' ,
9+ name : ' ioctl has glibc-style prototype'
10+ ),
11+ description : ' Is ioctl the glibc interface (rather than POSIX)'
12+ )
13+
114mock_ioctl = library (
215 ' mock-ioctl' ,
316 [' mock.c' , ' util.c' ],
4- dependencies : [dl_dep]
5- )
17+ dependencies : [dl_dep],
18+ c_args : [ ' -DHAVE_GLIBC_IOCTL= ' + (mock_conf.get( ' HAVE_GLIBC_IOCTL ' ) ? ' 1 ' : ' 0 ' )] )
619
720# Add mock-ioctl to the LD_PRELOAD path so it overrides libc.
821# Append to LD_PRELOAD so existing libraries, e.g. libasan, are kept.
You can’t perform that action at this time.
0 commit comments