diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2012-09-15 22:55:21 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-09-15 23:20:48 +0200 |
commit | 659c6a363bf84bd2520042ba80bc507763b57b78 (patch) | |
tree | 41079d20ca1d37959ee062eaabcf8cbc1bc3257d /solenv | |
parent | 7a042c8204628c573fc52d5fb4e4a5ba650b1604 (diff) |
Let --enable-assert-always-abort affect setting NDEBUG directly
For one, assert.h is designed to be includeable multiple times with changing
NDEBUG settings, so it is not robust to include it early in sal/macros.h with
"correct" NDEBUG settings and potentially include it again later. For another,
there is #ifndef NDEBUG code providing functionality used exclusively within
assert calls, which must be compiled with the same NDEBUG-setting as the
relevant #include <assert.h>.
Change-Id: I7b2f9c85f8e2155051274757c64162ed5a5e9d1b
Diffstat (limited to 'solenv')
-rw-r--r-- | solenv/gbuild/gbuild.mk | 11 | ||||
-rw-r--r-- | solenv/inc/settings.mk | 7 |
2 files changed, 10 insertions, 8 deletions
diff --git a/solenv/gbuild/gbuild.mk b/solenv/gbuild/gbuild.mk index a073e3961bd4..20ac7a0a0d9f 100644 --- a/solenv/gbuild/gbuild.mk +++ b/solenv/gbuild/gbuild.mk @@ -214,8 +214,13 @@ endif ifeq ($(gb_DEBUGLEVEL),0) gb_GLOBALDEFS += \ -DOPTIMIZE \ + +ifeq ($(strip $(ASSERT_ALWAYS_ABORT)),FALSE) +gb_GLOBALDEFS += \ -DNDEBUG \ +endif + else gb_GLOBALDEFS += \ -DSAL_LOG_INFO \ @@ -228,12 +233,6 @@ gb_GLOBALDEFS += \ endif endif -ifeq ($(strip $(ASSERT_ALWAYS_ABORT)),TRUE) -gb_GLOBALDEFS += \ - -DASSERT_ALWAYS_ABORT \ - -endif - ifneq ($(strip $(ENABLE_GTK)),) gb_GLOBALDEFS += -DENABLE_GTK endif diff --git a/solenv/inc/settings.mk b/solenv/inc/settings.mk index e24c0e6cd1d3..15bd3f0c7eb0 100644 --- a/solenv/inc/settings.mk +++ b/solenv/inc/settings.mk @@ -1074,10 +1074,13 @@ RSCDEFS+=-DDBG_UTIL .ENDIF .IF "$(product)"!="" -CDEFS+= -DPRODUCT -DNDEBUG -RSCDEFS+= -DPRODUCT +CDEFS+= -DPRODUCT +RSCDEFS+= -DPRODUCT +.IF "$(ASSERT_ALWAYS_ABORT)"=="FALSE" +CDEFS+=-DNDEBUG RSCDEFS+= -DNDEBUG .ENDIF +.ENDIF .IF "$(DBG_LEVEL)"!="" CDEFS+=-DOSL_DEBUG_LEVEL=$(DBG_LEVEL) |