-
Notifications
You must be signed in to change notification settings - Fork 74
/
LocalConfig.pri.orig
70 lines (51 loc) · 1.63 KB
/
LocalConfig.pri.orig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
CONFIG += release
CONFIG -= debug
#CONFIG += debug
#CONFIG -= release
debug {
DEFINES += DEBUG
# Generally -Og is recommended instead of -O0 but GDB and QtCreator struggle with -Og
QMAKE_CXXFLAGS+=-g -O0
QMAKE_CXXFLAGS+=-fno-omit-frame-pointer
# Runs expensive validation on several data structures to make sure everything is in sync.
#DEFINES += VALIDATE_ON
# Use this with valgrind
#QMAKE_CXXFLAGS+=-g -O1
# Enable this to turn on ASAN
#QMAKE_LFLAGS+=-fsanitize=address -static-libasan
}
release {
DEFINES -= DEBUG
# Turn on release optimizations
QMAKE_CXXFLAGS+=-O3
}
# ccache speeds up compiling
QMAKE_CXX=ccache g++
# Warn about uninitialized variables
QMAKE_CXXFLAGS+=-Wuninitialized
# If the g++ version is 4.0 to 4.4, then don't use maybe-uninitialized.
# I couldn't find the exact version maybe-unintialized was introduced, but
# I know it works in g++ 4.8.4 -JRS
system( g++ --version | grep -q -e " 4.[0-7]" ) {
# pass
} else {
QMAKE_CXXFLAGS+=-Wmaybe-uninitialized
}
# Enable the gold linker for faster build times
QMAKE_LFLAGS+=-fuse-ld=gold
# Set all uninitialized variables to their default values
#QMAKE_CXXFLAGS+=-fno-common
# Initialize values in BSS to zero
#QMAKE_CXXFLAGS+=-fzero-initialized-in-bss
# Show more warnings
QMAKE_CXXFLAGS+=-Wextra
QMAKE_CXXFLAGS+=-Wall
# Turn warnings into errors
QMAKE_CXXFLAGS+=-Werror
# Temporarily turn off compiler warning for "Incompatible Function Types"
QMAKE_CXXFLAGS+=-Wno-cast-function-type
# Enable the GEOS C++ API
DEFINES += USE_UNSTABLE_GEOS_CPP_API
# Turn on variable shadow tests
QMAKE_CXXFLAGS+=-Wshadow
QMAKE_CXXFLAGS+=-Wshadow-compatible-local