diff options
author | Pirama Arumuga Nainar <pirama@google.com> | 2015-02-23 09:53:16 -0800 |
---|---|---|
committer | Pirama Arumuga Nainar <pirama@google.com> | 2015-04-01 13:16:20 -0700 |
commit | 235e990832a13036d6fe0b128ba97fd8202d17d7 (patch) | |
tree | a1f71fee8d9508d346355b9662d451d649317fe1 | |
parent | 0e2c34f92f00628d48968dfea096d36381f494cb (diff) | |
download | clang-235e990832a13036d6fe0b128ba97fd8202d17d7.tar.gz |
Add flag to enable assertions in Clang
Add a flag CLANG_ENABLE_ASSERTIONS to enable assertions in Clang,
similar to LLVM_ENABLE_ASSERTIONS in llvm.
Change-Id: Id2a63516a98e4724f2157a41c0bfd621ff48bec3
-rw-r--r-- | Android.mk | 1 | ||||
-rw-r--r-- | clang-device-build.mk | 7 | ||||
-rw-r--r-- | clang-host-build.mk | 7 |
3 files changed, 15 insertions, 0 deletions
diff --git a/Android.mk b/Android.mk index 508814c904..8fe7cbd92a 100644 --- a/Android.mk +++ b/Android.mk @@ -1,5 +1,6 @@ LOCAL_PATH := $(call my-dir) CLANG_ROOT_PATH := $(LOCAL_PATH) +CLANG_ENABLE_ASSERTION := false include $(CLEAR_VARS) diff --git a/clang-device-build.mk b/clang-device-build.mk index 0bd088e967..28c7916f53 100644 --- a/clang-device-build.mk +++ b/clang-device-build.mk @@ -8,6 +8,13 @@ LOCAL_CPPFLAGS := \ -Wno-sign-promo \ $(LOCAL_CPPFLAGS) +ifeq ($(CLANG_ENABLE_ASSERTION),true) +LOCAL_CFLAGS := \ + $(LOCAL_CFLAGS) \ + -D_DEBUG \ + -UNDEBUG +endif + # Make sure bionic is first so we can include system headers. LOCAL_C_INCLUDES := \ $(CLANG_ROOT_PATH)/include \ diff --git a/clang-host-build.mk b/clang-host-build.mk index 81e9b1ef0f..3594cc4f85 100644 --- a/clang-host-build.mk +++ b/clang-host-build.mk @@ -8,6 +8,13 @@ LOCAL_CPPFLAGS := \ -Wno-sign-promo \ $(LOCAL_CPPFLAGS) +ifeq ($(CLANG_ENABLE_ASSERTION),true) +LOCAL_CFLAGS := \ + $(LOCAL_CFLAGS) \ + -D_DEBUG \ + -UNDEBUG +endif + # Make sure bionic is first so we can include system headers. LOCAL_C_INCLUDES := \ $(CLANG_ROOT_PATH)/include \ |