Skip to content

Commit

Permalink
add -DNDEBUG for non-debug build (#1006)
Browse files Browse the repository at this point in the history
* add -DNDEBUG for non-debug build

* Don't define NDEBUG if USE_ASSERTION is TRUE
  • Loading branch information
WeiqunZhang authored Jun 11, 2020
1 parent d73c9d1 commit c69e431
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Tools/GNUMake/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -825,6 +825,12 @@ ifeq ($(AMREX_XSDK),TRUE)
DEFINES += -DAMREX_XSDK
endif

ifneq ($(DEBUG),TRUE)
ifneq ($(USE_ASSERTION),TRUE)
DEFINES += -DNDEBUG
endif
endif

CPPFLAGS += $(DEFINES)

libraries = $(XTRAOBJS) $(LIBRARIES) $(XTRALIBS)
Expand Down
2 changes: 2 additions & 0 deletions Tools/GNUMake/Make.rules
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@ ifneq ($(MAKECMDGOALS),clean)
ifneq ($(MAKECMDGOALS),uninstall)
ifneq ($(MAKECMDGOALS),distclean)
ifneq ($(findstring print-,$(MAKECMDGOALS)),print-)
ifneq ($(MAKECMDGOALS),help)

ifeq ($(USE_GPU_PRAGMA),TRUE)
include $(TmpBuildDir)/$(optionsSuffix)_cuda_done
Expand Down Expand Up @@ -478,6 +479,7 @@ endif
endif
endif
endif
endif

ifneq ($(MAKECMDGOALS),$(filter $(MAKECMDGOALS),clean realclean file_locations tags TAGS uninstall distclean))
ifdef has_compiler_mismatch
Expand Down

0 comments on commit c69e431

Please sign in to comment.