target-host-required: Be permissive when ALLOW_MISSING_DEPENDENCY is set
add-all-host-to-target-required-modules-deps and
add-all-target-to-host-required-modules-deps permit errors when
ALLOW_MISSING_DEPENDENCY is set to true.
The previous behavior may break when doing unbundled builds.
Bug: 160318430
Bug: 7456955
Test: TH art-target-arm build pass
Change-Id: I00818d27ce18f4072eff9fa98958be820b5cd1f8
Merged-In: I00818d27ce18f4072eff9fa98958be820b5cd1f8
(cherry picked from commit 2c7c8bb65771d87b144b07c1d1d275a8f0893f82)
diff --git a/core/main.mk b/core/main.mk
index cc7cf72..114ec55 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -779,10 +779,13 @@
$(eval req_files := )\
$(foreach req_mod,$(req_mods), \
$(eval req_file := $(filter $(TARGET_OUT_ROOT)/%, $(call module-installed-files,$(req_mod)))) \
- $(if $(strip $(req_file)),\
- ,\
- $(error $(m).LOCAL_TARGET_REQUIRED_MODULES : illegal value $(req_mod) : not a device module. If you want to specify host modules to be required to be installed along with your host module, add those module names to LOCAL_REQUIRED_MODULES instead)\
- )\
+ $(if $(filter true,$(ALLOW_MISSING_DEPENDENCIES)), \
+ , \
+ $(if $(strip $(req_file)), \
+ , \
+ $(error $(m).LOCAL_TARGET_REQUIRED_MODULES : illegal value $(req_mod) : not a device module. If you want to specify host modules to be required to be installed along with your host module, add those module names to LOCAL_REQUIRED_MODULES instead) \
+ ) \
+ ) \
$(eval req_files := $(req_files)$(space)$(req_file))\
)\
$(eval req_files := $(strip $(req_files)))\
@@ -805,10 +808,13 @@
$(eval req_files := )\
$(foreach req_mod,$(req_mods), \
$(eval req_file := $(filter $(HOST_OUT)/%, $(call module-installed-files,$(req_mod)))) \
- $(if $(strip $(req_file)),\
- ,\
- $(error $(m).LOCAL_HOST_REQUIRED_MODULES : illegal value $(req_mod) : not a host module. If you want to specify target modules to be required to be installed along with your target module, add those module names to LOCAL_REQUIRED_MODULES instead)\
- )\
+ $(if $(filter true,$(ALLOW_MISSING_DEPENDENCIES)), \
+ , \
+ $(if $(strip $(req_file)), \
+ , \
+ $(error $(m).LOCAL_HOST_REQUIRED_MODULES : illegal value $(req_mod) : not a host module. If you want to specify target modules to be required to be installed along with your target module, add those module names to LOCAL_REQUIRED_MODULES instead) \
+ ) \
+ ) \
$(eval req_files := $(req_files)$(space)$(req_file))\
)\
$(eval req_files := $(strip $(req_files)))\