From f8c3669ba577724b24e5a53dcb630f6e195128f4 Mon Sep 17 00:00:00 2001 From: mikeller Date: Sun, 17 Jun 2018 10:51:13 +1200 Subject: [PATCH] Allow tests to define custom include directories (for libs). --- src/test/Makefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/test/Makefile b/src/test/Makefile index f7f89443b..cf7c9f202 100644 --- a/src/test/Makefile +++ b/src/test/Makefile @@ -20,6 +20,7 @@ include $(ROOT)/make/system-id.mk # variables available: # _SRC # _DEFINES +# _INCLUDE_DIRS alignsensor_unittest_SRC := \ @@ -478,6 +479,7 @@ $(OBJECT_DIR)/$1/%.c.o: $(USER_DIR)/%.c @echo "compiling $$<" "$(STDOUT)" $(V1) mkdir -p $$(dir $$@) $(V1) $(CC) $(C_FLAGS) $(TEST_CFLAGS) \ + $(foreach def,$($1_INCLUDE_DIRS),-I $(def)) \ $(foreach def,$($1_DEFINES),-D $(def)) \ -c $$< -o $$@ @@ -485,6 +487,7 @@ $(OBJECT_DIR)/$1/%.c.o: $(TEST_DIR)/%.c @echo "compiling test c file: $$<" "$(STDOUT)" $(V1) mkdir -p $$(dir $$@) $(V1) $(CC) $(C_FLAGS) $(TEST_CFLAGS) \ + $(foreach def,$($1_INCLUDE_DIRS),-I $(def)) \ $(foreach def,$($1_DEFINES),-D $(def)) \ -c $$< -o $$@ @@ -492,8 +495,9 @@ $(OBJECT_DIR)/$1/$1.o: $(TEST_DIR)/$1.cc @echo "compiling $$<" "$(STDOUT)" $(V1) mkdir -p $$(dir $$@) $(V1) $(CXX) $(CXX_FLAGS) $(TEST_CFLAGS) \ - $(foreach def,$($1_DEFINES),-D $(def)) \ - -c $$< -o $$@ + $(foreach def,$($1_INCLUDE_DIRS),-I $(def)) \ + $(foreach def,$($1_DEFINES),-D $(def)) \ + -c $$< -o $$@ $(OBJECT_DIR)/$1/$1 : $$($$1_OBJS) \