Support multiple arch for coverage packaging.

Modify copy rule to support multiple architectures. Use a method
similar to symbols.

Test: make lights.bullhead NATIVE_COVERAGE=true COVERAGE_PATHS=test/vts/hals/light/
Bug: 31911253
Change-Id: Ib3c53b4b305cbfcfd186010c5500b8d678190ddf
This commit is contained in:
Ryan Campbell 2016-10-03 11:23:40 -07:00
parent f009531772
commit c209ef8ce1
1 changed files with 9 additions and 3 deletions

View File

@ -96,17 +96,23 @@ built_static_gcno_libraries := \
STATIC_LIBRARIES,$(lib),$(my_kind),,$(LOCAL_2ND_ARCH_VAR_PREFIX), \
$(my_host_cross))/$(lib)$(gcno_suffix))
GCNO_ARCHIVE := $(LOCAL_MODULE)$(gcno_suffix)
ifdef LOCAL_IS_HOST_MODULE
my_coverage_path := $($(my_prefix)OUT_COVERAGE)/$(patsubst $($(my_prefix)OUT)/%,%,$(my_module_path))
else
my_coverage_path := $(TARGET_OUT_COVERAGE)/$(patsubst $(PRODUCT_OUT)/%,%,$(my_module_path))
endif
GCNO_ARCHIVE := $(basename $(my_installed_module_stem))$(gcno_suffix)
$(intermediates)/$(GCNO_ARCHIVE) : PRIVATE_ALL_OBJECTS := $(strip $(LOCAL_GCNO_FILES))
$(intermediates)/$(GCNO_ARCHIVE) : PRIVATE_ALL_WHOLE_STATIC_LIBRARIES := $(strip $(built_whole_gcno_libraries)) $(strip $(built_static_gcno_libraries))
$(intermediates)/$(GCNO_ARCHIVE) : $(LOCAL_GCNO_FILES) $(built_whole_gcno_libraries) $(built_static_gcno_libraries)
$(transform-o-to-static-lib)
$($(my_prefix)OUT_COVERAGE)/$(GCNO_ARCHIVE) : $(intermediates)/$(GCNO_ARCHIVE)
$(my_coverage_path)/$(GCNO_ARCHIVE) : $(intermediates)/$(GCNO_ARCHIVE)
$(copy-file-to-target)
$(LOCAL_BUILT_MODULE): $($(my_prefix)OUT_COVERAGE)/$(GCNO_ARCHIVE)
$(LOCAL_BUILT_MODULE): $(my_coverage_path)/$(GCNO_ARCHIVE)
endif
endif # skip_build_from_source