Skip to content

Commit 48bd0e4

Browse files
committed
[bld] Fix the include subdirectories variables in meson.build
I was incorrectly using 'inc' twice. That refers to the include/ directory here, but I was using it first for system includes. So rename the latter to sysinc for various checks in meson.build. I did this to fix the #include problem with libtoml/toml.h, which should not use relative includes. It should just name the file and let it get picked up via the -I search paths. Signed-off-by: David Cantrell <[email protected]>
1 parent 49bc40e commit 48bd0e4

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

libtoml/toml.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef TOML_H
22
#define TOML_H
33

4-
#include "../include/helpers.h"
4+
#include "helpers.h"
55
#include <stdio.h>
66

77
#ifdef __cplusplus

meson.build

+10-11
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ foreach dir : include_dirs
5252
existing_include_dirs += dir
5353
endif
5454
endforeach
55-
inc = include_directories(existing_include_dirs)
55+
sysinc = include_directories(existing_include_dirs)
5656

5757
# See if we have reallocarray in libc
5858
if cc.has_function('reallocarray')
@@ -141,8 +141,8 @@ if get_option('with_libkmod')
141141
libkmod = dependency('libkmod', required : true)
142142
add_project_arguments('-D_WITH_LIBKMOD', language : ['c', 'cpp'])
143143

144-
if not cc.has_header('libkmod.h', include_directories : inc)
145-
if cc.has_header('kmod/libkmod.h', include_directories : inc)
144+
if not cc.has_header('libkmod.h', include_directories : sysinc)
145+
if cc.has_header('kmod/libkmod.h', include_directories : sysinc)
146146
add_project_arguments('-D_LIBKMOD_HEADER_SUBDIR', language : ['c', 'cpp'])
147147
else
148148
error('*** unable to find libkmod.h')
@@ -286,10 +286,10 @@ if not cc.has_function('mparse_alloc', dependencies : [mandoc, zlib])
286286
error('*** unable to find mparse_alloc() in libmandoc')
287287
endif
288288

289-
if cc.has_header('mandoc_parse.h', include_directories : inc)
289+
if cc.has_header('mandoc_parse.h', include_directories : sysinc)
290290
add_project_arguments('-DNEWLIBMANDOC', language : ['c', 'cpp'])
291291
else
292-
if cc.has_header('mandoc/mandoc_parse.h', include_directories : inc)
292+
if cc.has_header('mandoc/mandoc_parse.h', include_directories : sysinc)
293293
add_project_arguments('-DNEWLIBMANDOC', language : ['c', 'cpp'])
294294
add_project_arguments('-DMANDOC_INCLUDE_SUBDIR', language : ['c', 'cpp'])
295295
else
@@ -383,25 +383,24 @@ m = declare_dependency(link_args : ['-lm'])
383383
cdson = dependency('cdson', required : true)
384384

385385
# Check for sys/queue.h
386-
if not cc.has_header('sys/queue.h', include_directories : inc)
386+
if not cc.has_header('sys/queue.h', include_directories : sysinc)
387387
message('<sys/queue.h> not found, using bundled copy')
388388
add_project_arguments('-D_COMPAT_QUEUE', language : ['c', 'cpp'])
389389
endif
390390

391+
# Header files for builds
392+
inc = include_directories('include')
393+
incxdiff = include_directories('libxdiff')
394+
391395
# libtoml
392396
# Default to bundled library, otherwise use the system one if we can.
393397
if get_option('with_system_libtoml') and cc.has_function('toml_init', args : ['-ltoml'])
394-
inctoml = include_directories('libtoml')
395398
toml = declare_dependency(link_args : ['-ltoml'])
396399
else
397400
inctoml = include_directories('libtoml')
398401
subdir('libtoml')
399402
endif
400403

401-
# Header files for builds
402-
inc = include_directories('include')
403-
incxdiff = include_directories('libxdiff')
404-
405404
# Include all of the relevant subdirectories of the source tree
406405
subdir('libxdiff')
407406
subdir('lib')

0 commit comments

Comments
 (0)