From 7429e21c2e64c1b27787e3768c30207532b56296 Mon Sep 17 00:00:00 2001 From: Ying Wang Date: Wed, 15 Aug 2012 10:59:10 -0700 Subject: [PATCH] Add LOCAL_CONLYFLAGS. To pass compiler flags LOCAL_CFLAGS: to both C and C++ files; LOCAL_CONLYFLAGS: to only C files but not C++ files; LOCAL_CPPFLAGS: to only C++ file. LOCAL_CPPFLAGS and LOCAL_CONLYFLAGS can override flags in LOCAL_CFLAGS. Bug: 6967573 Change-Id: I88d9de0980e451b94bc7ae8c741ea2030eada3e1 --- core/binary.mk | 1 + core/clear_vars.mk | 1 + core/definitions.mk | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/core/binary.mk b/core/binary.mk index 67f35441c..29d094937 100644 --- a/core/binary.mk +++ b/core/binary.mk @@ -661,6 +661,7 @@ endif ########################################################### $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_YACCFLAGS := $(LOCAL_YACCFLAGS) $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_ASFLAGS := $(LOCAL_ASFLAGS) +$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_CONLYFLAGS := $(LOCAL_CONLYFLAGS) $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_CFLAGS := $(LOCAL_CFLAGS) $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_CPPFLAGS := $(LOCAL_CPPFLAGS) $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_RTTI_FLAG := $(LOCAL_RTTI_FLAG) diff --git a/core/clear_vars.mk b/core/clear_vars.mk index a564b3cdd..bf7f93075 100644 --- a/core/clear_vars.mk +++ b/core/clear_vars.mk @@ -42,6 +42,7 @@ LOCAL_YACCFLAGS:= LOCAL_ASFLAGS:= LOCAL_CFLAGS:= LOCAL_CPPFLAGS:= +LOCAL_CONLYFLAGS:= LOCAL_RTTI_FLAG:= LOCAL_C_INCLUDES:= LOCAL_EXPORT_C_INCLUDE_DIRS:= diff --git a/core/definitions.mk b/core/definitions.mk index e8ec8a74f..2ab366bbe 100644 --- a/core/definitions.mk +++ b/core/definitions.mk @@ -930,7 +930,7 @@ endef define transform-c-to-o-no-deps @echo "target $(PRIVATE_ARM_MODE) C: $(PRIVATE_MODULE) <= $<" -$(call transform-c-or-s-to-o-no-deps, $(PRIVATE_CFLAGS) $(PRIVATE_DEBUG_CFLAGS)) +$(call transform-c-or-s-to-o-no-deps, $(PRIVATE_CFLAGS) $(PRIVATE_CONLYFLAGS) $(PRIVATE_DEBUG_CFLAGS)) endef define transform-s-to-o-no-deps @@ -1017,7 +1017,7 @@ endef define transform-host-c-to-o-no-deps @echo "host C: $(PRIVATE_MODULE) <= $<" -$(call transform-host-c-or-s-to-o-no-deps, $(PRIVATE_CFLAGS) $(PRIVATE_DEBUG_CFLAGS)) +$(call transform-host-c-or-s-to-o-no-deps, $(PRIVATE_CFLAGS) $(PRIVATE_CONLYFLAGS) $(PRIVATE_DEBUG_CFLAGS)) endef define transform-host-s-to-o-no-deps