Skip to content

Commit

Permalink
mk: add global-cppflags-y
Browse files Browse the repository at this point in the history
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 <jens.wiklander@linaro.org>
Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
  • Loading branch information
jenswi-linaro authored and jforissier committed Nov 1, 2024
1 parent 8f64525 commit b7c039e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mk/subdir.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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),)
Expand Down Expand Up @@ -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 :=
Expand Down

0 comments on commit b7c039e

Please sign in to comment.