From 2c1f5bc95f6a1224d3aa960206e72a9b314d153f Mon Sep 17 00:00:00 2001 From: Jens Wiklander Date: Fri, 18 Oct 2024 08:06:28 +0200 Subject: [PATCH] mk: add global-cppflags-y Add global-cppflags-y as a new sub.mk variable. The content of the variable is added to the C preprocessor flags passed to all files compiled in the current submodule, $(sm), similarly to how the content of global-incdirs-y is passed on. This flag is intended for libraries that in addition to exporting an include path also need certain defines set. Signed-off-by: Jens Wiklander Reviewed-by: Etienne Carriere --- mk/subdir.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mk/subdir.mk b/mk/subdir.mk index d280c309ecf..83b2a8ecf1e 100644 --- a/mk/subdir.mk +++ b/mk/subdir.mk @@ -140,6 +140,7 @@ endif include $1/sub.mk sub-subdirs := $$(addprefix $1/,$$(subdirs-y)) $$(subdirs_ext-y) +cppflags$(sm) := $$(cppflags$(sm)) $$(global-cppflags-y) incdirs$(sm) := $(incdirs$(sm)) $$(addprefix $1/,$$(global-incdirs-y)) thissubdir-incdirs := $(out-dir)/$(base-prefix)$1 $$(addprefix $1/,$$(incdirs-y)) $$(incdirs_ext-y) ifneq ($$(libname),) @@ -168,6 +169,7 @@ aflags-remove-y := subdirs-y := subdirs_ext-y := global-incdirs-y := +global-cppflags-y := incdirs-lib-y := incdirs-y := incdirs_ext-y :=