Skip to content

Commit 7a80510

Browse files
committed
fix: std C++17 case. patch: USE_UPNP=- as default. remove: USE_FORCE_STD_17=1
1 parent 5029d36 commit 7a80510

5 files changed

Lines changed: 26 additions & 11 deletions

File tree

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,14 +141,14 @@ cd DigitalNote
141141

142142
With UPNP:
143143
```
144-
qmake -qt=qt5 DigitalNote.daemon.pro USE_FORCE_STD_17=1
144+
qmake -qt=qt5 DigitalNote.daemon.pro USE_UPNP=1
145145
make -j 4
146146
sudo cp -r DigitalNoted /usr/local/bin/DigitalNoted
147147
```
148148

149149
**Recommended Without** UPNP:
150150
```
151-
qmake -qt=qt5 DigitalNote.daemon.pro USE_FORCE_STD_17=1 USE_UPNP=-
151+
qmake -qt=qt5 DigitalNote.daemon.pro USE_UPNP=-
152152
make -j 4
153153
sudo cp -r DigitalNoted /usr/local/bin/DigitalNoted
154154
```
@@ -165,13 +165,13 @@ export BDB_LIB_PATH="/usr/local/BerkeleyDB.6.2/lib"
165165

166166
With UPNP:
167167
```
168-
qmake -qt=qt5 DigitalNote.app.pro USE_FORCE_STD_17=1 USE_UPNP=- USE_DBUS=1 USE_QRCODE=1
168+
qmake -qt=qt5 DigitalNote.app.pro USE_DBUS=1 USE_QRCODE=1
169169
make -j 4
170170
```
171171

172172
**Recommended Without** UPNP:
173173
```
174-
qmake -qt=qt5 DigitalNote.app.pro USE_FORCE_STD_17=1 USE_UPNP=- USE_DBUS=1 USE_QRCODE=1
174+
qmake -qt=qt5 DigitalNote.app.pro USE_DBUS=1 USE_QRCODE=1
175175
make -j 4
176176
```
177177

include/compiler_settings.pri

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
CONFIG += strict_c++
22
CONFIG += c++17
33

4+
include(fix_std_cxx_17.pri)
5+
46
QMAKE_CXXFLAGS =
57

68
QMAKE_CXXFLAGS_WARN_ON = -fdiagnostics-show-option

include/fix_std_cxx_17.pri

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
## can be used with Qt 5.12 and later.
2+
## For Qt 5.11 and earlier, it is not a recognized QMake flag and you have to get your hands a bit dirty.
3+
##
4+
## Reference: https://stackoverflow.com/questions/46610996/cant-use-c17-features-using-g-7-2-in-qtcreator
5+
6+
7+
lessThan($$QT_MAJOR_VERSION, 5)
8+
{
9+
QMAKE_CXXFLAGS += -std=c++17
10+
}
11+
12+
isEqual($$QT_MINOR_VERSION, 5) | lessThan($$QT_MINOR_VERSION, 12)
13+
{
14+
QMAKE_CXXFLAGS += -std=c++17
15+
}

include/libs/miniupnpc.pri

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
# or: qmake "USE_UPNP=-" (not supported)
44
# miniupnpc (http://miniupnp.free.fr/files/) must be installed for support
55

6-
contains(USE_UPNP, -) {
7-
message(Building without UPNP support)
8-
} else {
6+
contains(USE_UPNP, 1) {
7+
message(Building UPNP support)
8+
99
win32 {
1010
exists($${DIGITALNOTE_LIB_MINIUPNP_DIR}/libminiupnpc.a) {
1111
message("found MiniUPNP lib")
@@ -36,4 +36,6 @@ contains(USE_UPNP, -) {
3636

3737
DEFINES += MINIUPNP_STATICLIB
3838
DEFINES += USE_UPNP
39+
} else {
40+
message(Building without UPNP support)
3941
}

include/options/use_force_std.pri

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
## can be used with Qt 5.12 and later.
2-
## For Qt 5.11 and earlier, it is not a recognized QMake flag and you have to get your hands a bit dirty.
3-
##
4-
## Reference: https://stackoverflow.com/questions/46610996/cant-use-c17-features-using-g-7-2-in-qtcreator
51

62
contains(USE_FORCE_STD_17, 1) {
73
QMAKE_CXXFLAGS += -std=c++17

0 commit comments

Comments
 (0)