summaryrefslogtreecommitdiffstats
path: root/core/binary.mk
diff options
context:
space:
mode:
authorDan Albert <danalbert@google.com>2015-01-24 23:42:09 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-01-24 23:42:09 +0000
commit3723af1b4e8de4941d7b9be569f209d88f565964 (patch)
treee91d388bfe85e4c242acda83c89032e6946c97e6 /core/binary.mk
parent6698ba3d6c9efebac63c224a1fb985f0a53a501a (diff)
parent9ba25d6bfd983655dc9c0584887db2b6cb3be999 (diff)
downloadbuild-3723af1b4e8de4941d7b9be569f209d88f565964.zip
build-3723af1b4e8de4941d7b9be569f209d88f565964.tar.gz
build-3723af1b4e8de4941d7b9be569f209d88f565964.tar.bz2
am 9ba25d6b: Merge "Enable host coverage."
* commit '9ba25d6bfd983655dc9c0584887db2b6cb3be999': Enable host coverage.
Diffstat (limited to 'core/binary.mk')
-rw-r--r--core/binary.mk54
1 files changed, 27 insertions, 27 deletions
diff --git a/core/binary.mk b/core/binary.mk
index 105082b..1d7b619 100644
--- a/core/binary.mk
+++ b/core/binary.mk
@@ -253,33 +253,6 @@ my_target_global_cppflags += $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_GLOBAL_CPPFLAG
my_target_global_ldflags := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_GLOBAL_LDFLAGS)
endif # my_clang
-# To enable coverage for a given module, set LOCAL_NATIVE_COVERAGE=true and
-# build with NATIVE_COVERAGE=true in your enviornment. Note that the build
-# system is not sensitive to changes to NATIVE_COVERAGE, so you should do a
-# clean build of your module after toggling it.
-ifeq ($(NATIVE_COVERAGE),true)
- ifeq ($(my_native_coverage),true)
- # We can't currently generate coverage for clang binaries for two
- # reasons:
- #
- # 1) b/17574078 We currently don't have a prebuilt
- # libclang_rt.profile-<ARCH>.a, which clang is hardcoded to link if
- # --coverage is passed in the link stage. For now we manually link
- # libprofile_rt (which is the name it is built as from
- # external/compiler-rt).
- #
- # 2) b/17583330 Clang doesn't generate .gcno files when using
- # -no-integrated-as. Since most of the assembly in our tree is
- # incompatible with clang's assembler, we can't turn off this flag.
- ifneq ($(my_clang),true)
- my_cflags += --coverage -O0
- my_ldflags += --coverage
- endif
- endif
-else
- my_native_coverage := false
-endif
-
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_TARGET_PROJECT_INCLUDES := $(my_target_project_includes)
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_TARGET_C_INCLUDES := $(my_target_c_includes)
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_TARGET_GLOBAL_CFLAGS := $(my_target_global_cflags)
@@ -310,6 +283,33 @@ $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_HOST_GLOBAL_CPPFLAGS := $(my_host_global_
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_HOST_GLOBAL_LDFLAGS := $(my_host_global_ldflags)
endif # LOCAL_IS_HOST_MODULE
+# To enable coverage for a given module, set LOCAL_NATIVE_COVERAGE=true and
+# build with NATIVE_COVERAGE=true in your enviornment. Note that the build
+# system is not sensitive to changes to NATIVE_COVERAGE, so you should do a
+# clean build of your module after toggling it.
+ifeq ($(NATIVE_COVERAGE),true)
+ ifeq ($(my_native_coverage),true)
+ # We can't currently generate coverage for clang binaries for two
+ # reasons:
+ #
+ # 1) b/17574078 We currently don't have a prebuilt
+ # libclang_rt.profile-<ARCH>.a, which clang is hardcoded to link if
+ # --coverage is passed in the link stage. For now we manually link
+ # libprofile_rt (which is the name it is built as from
+ # external/compiler-rt).
+ #
+ # 2) b/17583330 Clang doesn't generate .gcno files when using
+ # -no-integrated-as. Since most of the assembly in our tree is
+ # incompatible with clang's assembler, we can't turn off this flag.
+ ifneq ($(my_clang),true)
+ my_cflags += --coverage -O0
+ my_ldflags += --coverage
+ endif
+ endif
+else
+ my_native_coverage := false
+endif
+
###########################################################
## Define PRIVATE_ variables used by multiple module types
###########################################################