Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit ed50d38

Browse files
committed
Standardise all build-mode affecting {EN,DIS}ABLE_* make options to
test equality to 1, and fix/update documentation to reflect this git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117094 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 9cf3b58 commit ed50d38

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

Makefile.rules

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -301,25 +301,25 @@ ifneq ($(REQUIRES_RTTI), 1)
301301
CXX.Flags += -fno-rtti
302302
endif
303303

304-
ifdef ENABLE_COVERAGE
304+
ifeq ($(ENABLE_COVERAGE),1)
305305
BuildMode := $(BuildMode)+Coverage
306306
CXX.Flags += -ftest-coverage -fprofile-arcs
307307
C.Flags += -ftest-coverage -fprofile-arcs
308308
endif
309309

310310
# If DISABLE_ASSERTIONS=1 is specified (make command line or configured),
311311
# then disable assertions by defining the appropriate preprocessor symbols.
312-
ifndef DISABLE_ASSERTIONS
312+
ifeq ($(DISABLE_ASSERTIONS),1)
313+
CPP.Defines += -DNDEBUG
314+
else
313315
BuildMode := $(BuildMode)+Asserts
314316
CPP.Defines += -D_DEBUG
315-
else
316-
CPP.Defines += -DNDEBUG
317317
endif
318318

319319
# If ENABLE_EXPENSIVE_CHECKS=1 is specified (make command line or
320320
# configured), then enable expensive checks by defining the
321321
# appropriate preprocessor symbols.
322-
ifdef ENABLE_EXPENSIVE_CHECKS
322+
ifeq ($(ENABLE_EXPENSIVE_CHECKS),1)
323323
BuildMode := $(BuildMode)+Checks
324324
CPP.Defines += -D_GLIBCXX_DEBUG -DXDEBUG
325325
endif

docs/MakefileGuide.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -640,18 +640,18 @@
640640
generate dependencies when running the compiler. Use of this feature is
641641
discouraged and it may be removed at a later date.</dd>
642642
<dt><a name="ENABLE_OPTIMIZED"><tt>ENABLE_OPTIMIZED</tt></a></dt>
643-
<dd>If set to any value, causes the build to generate optimized objects,
643+
<dd>If set to 1, causes the build to generate optimized objects,
644644
libraries and executables. This alters the flags specified to the compilers
645645
and linkers. Generally debugging won't be a fun experience with an optimized
646646
build.</dd>
647647
<dt><a name="ENABLE_PROFILING"><tt>ENABLE_PROFILING</tt></a></dt>
648-
<dd>If set to any value, causes the build to generate both optimized and
648+
<dd>If set to 1, causes the build to generate both optimized and
649649
profiled objects, libraries and executables. This alters the flags specified
650650
to the compilers and linkers to ensure that profile data can be collected
651651
from the tools built. Use the <tt>gprof</tt> tool to analyze the output from
652652
the profiled tools (<tt>gmon.out</tt>).</dd>
653653
<dt><a name="DISABLE_ASSERTIONS"><tt>DISABLE_ASSERTIONS</tt></a></dt>
654-
<dd>If set to any value, causes the build to disable assertions, even if
654+
<dd>If set to 1, causes the build to disable assertions, even if
655655
building a debug or profile build. This will exclude all assertion check
656656
code from the build. LLVM will execute faster, but with little help when
657657
things go wrong.</dd>

0 commit comments

Comments
 (0)