From e1ec9bfcec8f540a32169bb7fb79ae0ee951c9ae Mon Sep 17 00:00:00 2001 From: Martin Belanger Date: Tue, 15 Aug 2023 15:16:24 -0400 Subject: [PATCH] meson: Don't hard-code path to "internal/config.h" 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 --- internal/meson.build | 7 +++++++ meson.build | 1 - 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/internal/meson.build b/internal/meson.build index fde4ccac..cc1e852b 100644 --- a/internal/meson.build +++ b/internal/meson.build @@ -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', +) diff --git a/meson.build b/meson.build index 77415ebe..59f443e7 100644 --- a/meson.build +++ b/meson.build @@ -253,7 +253,6 @@ add_project_arguments( [ '-fomit-frame-pointer', '-D_GNU_SOURCE', - '-include', 'internal/config.h', ], language : 'c', ) -- 2.49.0