summaryrefslogtreecommitdiff
path: root/libphobos/libdruntime
diff options
context:
space:
mode:
authorIain Buclaw <ibuclaw@gdcproject.org>2020-04-09 00:41:14 +0200
committerIain Buclaw <ibuclaw@gdcproject.org>2020-04-09 00:46:39 +0200
commitc0dbfbd763ad77d6beaa345ce94afc93e193236e (patch)
treea5ddb4962be29e04a4ab27209a22c240af5114fc /libphobos/libdruntime
parent6e286c8df452787fffe4fb4bd3dbba4d80bc6c12 (diff)
libphobos: Add --enable-libphobos-checking configure option
As GDCFLAGS is overriden by the top-level make file with '-O2 -g', libphobos ends up always being built with all contracts, invariants, and asserts compiled in. This adds a new configurable that defaults to omit compiling any run-time checks into the library using '-frelease'. Other choices either set the flags '-fno-release', enabling all run-time checks, or '-fassert', which only compiles in asserts. The omission of compiling in contracts results in a smaller library size, with faster build times. libphobos/ChangeLog: PR d/94305 * Makefile.in: Regenerate. * configure: Regenerate. * configure.ac: Add --enable-libphobos-checking and substitute CHECKING_DFLAGS. Remove -frelease from GDCFLAGS. * libdruntime/Makefile.am: Add CHECKING_DFLAGS to AM_DFLAGS. * libdruntime/Makefile.in: Regenerate. * src/Makefile.am: Add CHECKING_DFLAGS to AM_DFLAGS. * src/Makefile.in: Regenerate. * testsuite/Makefile.in: Regenerate. * testsuite/testsuite_flags.in: Add -fno-release -funittest to --gdcflags.
Diffstat (limited to 'libphobos/libdruntime')
-rw-r--r--libphobos/libdruntime/Makefile.am2
-rw-r--r--libphobos/libdruntime/Makefile.in3
2 files changed, 3 insertions, 2 deletions
diff --git a/libphobos/libdruntime/Makefile.am b/libphobos/libdruntime/Makefile.am
index 41ccfaa339c..c7b03a5967d 100644
--- a/libphobos/libdruntime/Makefile.am
+++ b/libphobos/libdruntime/Makefile.am
@@ -24,7 +24,7 @@ D_EXTRA_DFLAGS=-nostdinc -I $(srcdir) -I .
# D flags for compilation
AM_DFLAGS= \
$(phobos_compiler_pic_flag) \
- $(WARN_DFLAGS)
+ $(WARN_DFLAGS) $(CHECKING_DFLAGS)
# Install all D and DI files
ALL_DRUNTIME_INSTALL_DSOURCES = $(DRUNTIME_DSOURCES) \
diff --git a/libphobos/libdruntime/Makefile.in b/libphobos/libdruntime/Makefile.in
index 9277e0a1665..e0688e25c81 100644
--- a/libphobos/libdruntime/Makefile.in
+++ b/libphobos/libdruntime/Makefile.in
@@ -555,6 +555,7 @@ CCASFLAGS = @CCASFLAGS@
CC_FOR_BUILD = @CC_FOR_BUILD@
CFLAGS = @CFLAGS@
CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
+CHECKING_DFLAGS = @CHECKING_DFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
@@ -715,7 +716,7 @@ D_EXTRA_DFLAGS = -nostdinc -I $(srcdir) -I .
# D flags for compilation
AM_DFLAGS = \
$(phobos_compiler_pic_flag) \
- $(WARN_DFLAGS)
+ $(WARN_DFLAGS) $(CHECKING_DFLAGS)
# Install all D and DI files