Skip to content

Commit fe9e613

Browse files
committed
Add general PRO file for console builds.
It is easier to maintain PRO files when we keep all the console- build specific general options in one file. For example changes to compiler options affect to all console builds.
1 parent f98179a commit fe9e613

4 files changed

Lines changed: 30 additions & 54 deletions

File tree

cli/cli.pro

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ OBJECTS_DIR = temp
66
CONFIG += warn_on
77
CONFIG -= qt app_bundle
88

9+
include(../console_common.pri)
10+
911
BASEPATH = ../externals/tinyxml/
1012
include($$PWD/../externals/tinyxml/tinyxml.pri)
1113
BASEPATH = ../lib/
@@ -24,30 +26,15 @@ HEADERS += cppcheckexecutor.h \
2426
pathmatch.h \
2527
threadexecutor.h
2628

27-
CONFIG(release, debug|release) {
28-
DEFINES += NDEBUG
29-
}
30-
3129
win32 {
32-
CONFIG += embed_manifest_exe console
33-
DEFINES += _CRT_SECURE_NO_WARNINGS
3430
RC_FILE = cppcheck.rc
3531
HEADERS += resource.h
36-
LIBS += -lshlwapi
3732
}
3833

39-
# Add more strict compiling flags for GCC
34+
# Enable STL checking in GCC debug builds
4035
contains(QMAKE_CXX, g++) {
41-
QMAKE_CXXFLAGS_WARN_ON += -Wextra -pedantic -Wfloat-equal -Wcast-qual -Wlogical-op -Wno-long-long
42-
4336
CONFIG(debug, debug|release) {
4437
# checked STL
4538
DEFINES += _GLIBCXX_DEBUG
4639
}
4740
}
48-
49-
# Change Visual Studio compiler (CL) warning level to W4
50-
contains(QMAKE_CXX, cl) {
51-
QMAKE_CXXFLAGS_WARN_ON -= -W3
52-
QMAKE_CXXFLAGS_WARN_ON += -W4
53-
}

console_common.pri

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# console_common.pri
2+
# These are common definitions for console builds.
3+
4+
win32 {
5+
CONFIG += embed_manifest_exe console
6+
DEFINES += _CRT_SECURE_NO_WARNINGS
7+
LIBS += -lshlwapi
8+
}
9+
10+
# Add more strict compiling flags for GCC
11+
contains(QMAKE_CXX, g++) {
12+
QMAKE_CXXFLAGS_WARN_ON += -Wextra -pedantic -Wfloat-equal -Wcast-qual -Wlogical-op -Wno-long-long
13+
}
14+
15+
# Change Visual Studio compiler (CL) warning level to W4
16+
contains(QMAKE_CXX, cl) {
17+
QMAKE_CXXFLAGS_WARN_ON -= -W3
18+
QMAKE_CXXFLAGS_WARN_ON += -W4
19+
}
20+
21+
CONFIG(release, debug|release) {
22+
DEFINES += NDEBUG
23+
}

test/test.pro

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ INCLUDEPATH += . ../cli ../lib
66
OBJECTS_DIR = temp
77
CONFIG += warn_on console
88
CONFIG -= qt app_bundle
9-
win32 {
10-
LIBS += -lshlwapi
11-
}
9+
10+
include(../console_common.pri)
1211

1312
BASEPATH = ../externals/tinyxml/
1413
include(../externals/tinyxml/tinyxml.pri)
@@ -30,14 +29,5 @@ HEADERS += ../cli/cmdlineparser.h \
3029
../cli/pathmatch.h \
3130
../cli/threadexecutor.h
3231

33-
# test/*
34-
3532
HEADERS += options.h redirect.h testsuite.h
3633
SOURCES += options.cpp
37-
38-
# Change Visual Studio compiler (CL) warning level to W4
39-
contains(QMAKE_CXX, cl) {
40-
QMAKE_CXXFLAGS_WARN_ON -= -W3
41-
QMAKE_CXXFLAGS_WARN_ON += -W4
42-
DEFINES += _CRT_SECURE_NO_WARNINGS
43-
}

tools/tools.pro

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,11 @@ OBJECTS_DIR = temp
66
CONFIG += warn_on
77
CONFIG -= qt app_bundle
88

9+
include(../console_common.pri)
10+
911
SOURCES += dmake.cpp \
1012
../cli/filelister.cpp \
1113
../lib/path.cpp
1214

1315
HEADERS += ../cli/filelister.h \
1416
../lib/path.h
15-
16-
CONFIG(release, debug|release) {
17-
DEFINES += NDEBUG
18-
}
19-
20-
win32 {
21-
CONFIG += embed_manifest_exe console
22-
DEFINES += _CRT_SECURE_NO_WARNINGS
23-
LIBS += -lshlwapi
24-
}
25-
26-
# Add more strict compiling flags for GCC
27-
contains(QMAKE_CXX, g++) {
28-
QMAKE_CXXFLAGS_WARN_ON += -Wextra -pedantic -Wfloat-equal -Wcast-qual -Wlogical-op -Wno-long-long
29-
30-
CONFIG(debug, debug|release) {
31-
# checked STL
32-
DEFINES += _GLIBCXX_DEBUG
33-
}
34-
}
35-
36-
# Change Visual Studio compiler (CL) warning level to W4
37-
contains(QMAKE_CXX, cl) {
38-
QMAKE_CXXFLAGS_WARN_ON -= -W3
39-
QMAKE_CXXFLAGS_WARN_ON += -W4
40-
}

0 commit comments

Comments
 (0)