Skip to content

Commit

Permalink
Specify -DNDEBUG when compiling in optimizing mode
Browse files Browse the repository at this point in the history
  • Loading branch information
kspangsege committed May 7, 2013
1 parent 3f8f380 commit 89ce04d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,6 @@ There are also a number of environment variables that serve to enable
or disable special features during building:

Set `TIGHTDB_ENABLE_REPLICATION` to a nonempty value to enable
replication.
replication. For example:

TIGHTDB_ENABLE_REPLICATION=1 sh build.sh src-dist all
5 changes: 4 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ TIGHTDB_HOME="$(pwd)"
MODE="$1"
[ $# -gt 0 ] && shift

EXTENSIONS="java python objc node php c gui replication"
EXTENSIONS="java python objc node php c gui"

if [ "$TIGHTDB_ENABLE_REPLICATION" ]; then
EXTENSIONS="$EXTENSIONS replication"
fi


map_ext_name_to_dir()
Expand Down
16 changes: 10 additions & 6 deletions generic.mk
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
# local Makefile.
SOURCE_ROOT =

CFLAGS_OPTIM =
CFLAGS_OPTIM = -DNDEBUG
CFLAGS_DEBUG =
CFLAGS_COVER =
CFLAGS_SHARED =
Expand All @@ -68,9 +68,9 @@ CFLAGS_OBJC =
CFLAGS_ARCH =
CFLAGS_INCLUDE =
CFLAGS_AUTODEP =
LDFLAGS_OPTIM = $(CFLAGS_OPTIM)
LDFLAGS_DEBUG = $(CFLAGS_DEBUG)
LDFLAGS_COVER = $(CFLAGS_COVER)
LDFLAGS_OPTIM = $(filter-out -D%,$(CFLAGS_OPTIM))
LDFLAGS_DEBUG = $(filter-out -D%,$(CFLAGS_DEBUG))
LDFLAGS_COVER = $(filter-out -D%,$(CFLAGS_COVER))
LDFLAGS_SHARED =
LDFLAGS_PTHREAD = $(CFLAGS_PTHREAD)
LDFLAGS_GENERAL =
Expand Down Expand Up @@ -286,7 +286,7 @@ endif
endif
CC_AND_CXX_ARE_GCC_LIKE = $(and $(call IS_GCC_LIKE,$(CC)),$(or $(call IS_GCC_LIKE,$(CXX)),$(call IS_GXX_LIKE,$(CXX))))
ifneq ($(CC_AND_CXX_ARE_GCC_LIKE),)
CFLAGS_OPTIM = -O3
CFLAGS_OPTIM = -O3 -DNDEBUG
CFLAGS_DEBUG = -ggdb
CFLAGS_COVER = --coverage
CFLAGS_SHARED = -fPIC -DPIC
Expand Down Expand Up @@ -788,7 +788,11 @@ $(eval $(TEST_RULES))

# LINKING PROGRAMS

# FIXME: Add '-Wl,-rpath' if linking against locally built and installed libraries, but it requires us to know the library installation directory. Or maybe it is better to set LD_RUN_PATH.
# FIXME: Add '-Wl,-rpath' if linking against locally built and
# installed libraries. This will allow the programs to find the
# installed libraries even if they are installed into a non-standard
# location. But it requires us to know the library installation
# directory. Or maybe it is better to set LD_RUN_PATH.

# neither inst nor noinst libs can have noinst lib dependencies
# noinst libs can have associated LDFLAGS
Expand Down

0 comments on commit 89ce04d

Please sign in to comment.