]> www.infradead.org Git - users/sagi/libnvme.git/commitdiff
meson: Don't hard-code path to "internal/config.h"
authorMartin Belanger <martin.belanger@dell.com>
Tue, 15 Aug 2023 19:16:24 +0000 (15:16 -0400)
committerDaniel Wagner <wagi@monom.org>
Wed, 16 Aug 2023 09:16:52 +0000 (11:16 +0200)
When building libnvme as a subproject of another project
(e.g. nvme-stas), the hard-coded absolute path to config.h, i.e.
"-include internal/config.h" does not resolve properly and fails
to build. Instead, use the real path calculated by meson and
saved to variable "config_h".

Signed-off-by: Martin Belanger <martin.belanger@dell.com>
internal/meson.build
meson.build

index fde4ccac3562a6920289a8491182a1154da024be..cc1e852ba473bb46838ab8053b434df0e7e2dc0a 100644 (file)
@@ -19,3 +19,10 @@ internal_incdir = include_directories('.')
 config_dep = declare_dependency(
   include_directories : internal_incdir,
   sources: config_h)
+
+add_project_arguments(
+    [
+        '-include', '@0@'.format(config_h),
+    ],
+    language : 'c',
+)
index 77415ebeed871364f6e54f170ed0165ed72e8d60..59f443e7bd087df6ce49dd270f78c3070cc4b6e1 100644 (file)
@@ -253,7 +253,6 @@ add_project_arguments(
     [
         '-fomit-frame-pointer',
         '-D_GNU_SOURCE',
-        '-include', 'internal/config.h',
     ],
     language : 'c',
 )