From: Martin Belanger Date: Tue, 15 Aug 2023 19:16:24 +0000 (-0400) Subject: meson: Don't hard-code path to "internal/config.h" X-Git-Tag: v1.6~54 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=e1ec9bfcec8f540a32169bb7fb79ae0ee951c9ae;p=users%2Fsagi%2Flibnvme.git 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 --- 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', )