Merge "Improve checks for include dirs outside the source tree"

This commit is contained in:
Treehugger Robot
2019-12-06 21:49:25 +00:00
committed by Gerrit Code Review
3 changed files with 38 additions and 2 deletions

View File

@@ -1295,9 +1295,13 @@ endif
my_c_includes := $(foreach inc,$(my_c_includes),$(call clean-path,$(inc)))
my_outside_includes := $(filter-out $(OUT_DIR)/%,$(filter /%,$(my_c_includes)))
my_outside_includes := $(filter-out $(OUT_DIR)/%,$(filter /%,$(my_c_includes)) $(filter ../%,$(my_c_includes)))
ifneq ($(my_outside_includes),)
$(error $(LOCAL_MODULE_MAKEFILE): $(LOCAL_MODULE): C_INCLUDES must be under the source or output directories: $(my_outside_includes))
ifeq ($(BUILD_BROKEN_OUTSIDE_INCLUDE_DIRS),true)
$(call pretty-warning,C_INCLUDES must be under the source or output directories: $(my_outside_includes))
else
$(call pretty-error,C_INCLUDES must be under the source or output directories: $(my_outside_includes))
endif
endif
# all_objects includes gen_o_objects which were part of LOCAL_GENERATED_SOURCES;