From 0881ba83fff5f8e5ebcfb1f64df57206901dfe07 Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Wed, 5 Jul 2017 11:56:41 +0800 Subject: [PATCH] build system: Order private include directories before public ones This allows the component to override a header in a public include directory, when only its own source files are being compiled. --- make/component_wrapper.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/make/component_wrapper.mk b/make/component_wrapper.mk index 0ed08b6a91..0ca5a25ddc 100644 --- a/make/component_wrapper.mk +++ b/make/component_wrapper.mk @@ -104,7 +104,7 @@ COMPONENT_EMBED_OBJS ?= $(addsuffix .bin.o,$(notdir $(COMPONENT_EMBED_FILES))) $ # variable with all the include dirs from all the components in random order. This # means we can accidentally grab a header from another component before grabbing our own. # To make sure that does not happen, re-order the includes so ours come first. -OWN_INCLUDES:=$(abspath $(addprefix $(COMPONENT_PATH)/,$(COMPONENT_ADD_INCLUDEDIRS) $(COMPONENT_PRIV_INCLUDEDIRS))) +OWN_INCLUDES:=$(abspath $(addprefix $(COMPONENT_PATH)/,$(COMPONENT_PRIV_INCLUDEDIRS) $(COMPONENT_ADD_INCLUDEDIRS))) COMPONENT_INCLUDES := $(OWN_INCLUDES) $(filter-out $(OWN_INCLUDES),$(COMPONENT_INCLUDES))