Don't treat warnings as error when building release
Summary: This will reduce errors reported by open source by 90%. Developers should have warnings break their compile. Users shouldn't. Test Plan: make dbg: g++ -g -W -Wextra -Wall -Wsign-compare -Wshadow -Wno-unused-parameter -Werror -I. -I./include -std=c++11 -DROCKSDB_PLATFORM_POSIX -DOS_LINUX -fno-builtin-memcmp -DROCKSDB_FALLOCATE_PRESENT -DSNAPPY -DGFLAGS=gflags -DZLIB -DBZIP2 -march=native -isystem ./third-party/gtest-1.7.0/fused-src -Woverloaded-virtual -Wn on-virtual-dtor -Wno-missing-field-initializers -c db/repair.cc -o db/repair.o make all: g++ -g -W -Wextra -Wall -Wsign-compare -Wshadow -Wno-unused-parameter -Werror -I. -I./include -std=c++11 -DROCKSDB_PLATFORM_POSIX -DOS_LINUX -fno-builtin-memcmp -DROCKSDB_FALLOCATE_PRESENT -DSNAPPY -DGFLAGS=gflags -DZLIB -DBZIP2 -march=native -isystem ./third-party/gtest-1.7.0/fused-src -O2 -fno-omit-frame-pointer -momit-leaf-frame-pointer -Woverloaded-virtual -Wnon-virtual-dtor -Wno-missing-field-initializers -c db/repair.cc -o db/repair.o make static_lib: g++ -g -W -Wextra -Wall -Wsign-compare -Wshadow -Wno-unused-parameter -I. -I./include -std=c++11 -DROCKSDB_PLATFORM_POSIX -DOS_LINUX -fno-builtin-memcmp -DROCKSDB_FALLOCATE_PRESENT -DSNAPPY -DGFLAGS=gflags -DZLIB -DBZIP2 -march=native -isystem ./third-party/gtest-1.7.0/fused-src -O2 -fno-omit-frame-pointer -momit-leaf-frame-pointer -DNDEBUG -Woverloaded-virtual -Wnon-virtual-dtor -Wno-missing-field-initializers -c db/repair.cc -o db/repair.o Reviewers: sdong, yhchiang, rven Reviewed By: rven Subscribers: dhruba, leveldb Differential Revision: https://reviews.facebook.net/D38031
This commit is contained in:
parent
9aa011fa36
commit
a2c4cc7562
64
Makefile
64
Makefile
@ -21,33 +21,57 @@ perl_command = perl -n \
|
|||||||
-e 'printf "%7.3f %s %s\n", $$a[3], $$a[6] == 0 ? "PASS" : "FAIL", $$t'
|
-e 'printf "%7.3f %s %s\n", $$a[3], $$a[6] == 0 ? "PASS" : "FAIL", $$t'
|
||||||
quoted_perl_command = $(subst ','\'',$(perl_command))
|
quoted_perl_command = $(subst ','\'',$(perl_command))
|
||||||
|
|
||||||
ifneq ($(MAKECMDGOALS),dbg)
|
# DEBUG_LEVEL can have three values:
|
||||||
|
# * DEBUG_LEVEL=2; this is the ultimate debug mode. It will compile rocksdb
|
||||||
|
# without any optimizations. To compile with level 2, issue `make dbg`
|
||||||
|
# * DEBUG_LEVEL=1; debug level 1 enables all assertions and debug code, but
|
||||||
|
# compiles rocksdb with -O2 optimizations. this is the default debug level.
|
||||||
|
# `make all` or `make <binary_target>` compile RocksDB with debug level 1.
|
||||||
|
# We use this debug level when developing RocksDB.
|
||||||
|
# * DEBUG_LEVEL=0; this is the debug level we use for release. If you're
|
||||||
|
# running rocksdb in production you most definitely want to compile RocksDB
|
||||||
|
# with debug level 0. To compile with level 0, run `make shared_lib`,
|
||||||
|
# `make install-shared`, `make static_lib`, `make install-static` or
|
||||||
|
# `make install`
|
||||||
|
DEBUG_LEVEL=1
|
||||||
|
|
||||||
|
ifeq ($(MAKECMDGOALS),dbg)
|
||||||
|
DEBUG_LEVEL=2
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(MAKECMDGOALS),shared_lib)
|
||||||
|
DEBUG_LEVEL=0
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(MAKECMDGOALS),install-shared)
|
||||||
|
DEBUG_LEVEL=0
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(MAKECMDGOALS),static_lib)
|
||||||
|
DEBUG_LEVEL=0
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(MAKECMDGOALS),install-static)
|
||||||
|
DEBUG_LEVEL=0
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(MAKECMDGOALS),install)
|
||||||
|
DEBUG_LEVEL=0
|
||||||
|
endif
|
||||||
|
|
||||||
|
# compile with -O2 if debug level is not 2
|
||||||
|
ifneq ($(DEBUG_LEVEL), 2)
|
||||||
OPT += -O2 -fno-omit-frame-pointer
|
OPT += -O2 -fno-omit-frame-pointer
|
||||||
ifneq ($(MACHINE),ppc64) # ppc64 doesn't support -momit-leaf-frame-pointer
|
ifneq ($(MACHINE),ppc64) # ppc64 doesn't support -momit-leaf-frame-pointer
|
||||||
OPT += -momit-leaf-frame-pointer
|
OPT += -momit-leaf-frame-pointer
|
||||||
endif
|
endif
|
||||||
else
|
|
||||||
# intentionally left blank
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(MAKECMDGOALS),shared_lib)
|
# if we're compiling for release, compile without debug code (-DNDEBUG) and
|
||||||
OPT += -DNDEBUG
|
# don't treat warnings as errors
|
||||||
endif
|
ifeq ($(DEBUG_LEVEL),0)
|
||||||
|
|
||||||
ifeq ($(MAKECMDGOALS),install-shared)
|
|
||||||
OPT += -DNDEBUG
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(MAKECMDGOALS),static_lib)
|
|
||||||
OPT += -DNDEBUG
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(MAKECMDGOALS),install-static)
|
|
||||||
OPT += -DNDEBUG
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(MAKECMDGOALS),install)
|
|
||||||
OPT += -DNDEBUG
|
OPT += -DNDEBUG
|
||||||
|
DISABLE_WARNING_AS_ERROR=1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
#-----------------------------------------------
|
#-----------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user