Skip to content

Commit e76e96d

Browse files
Add support for c++ 20 also with gcc 9
1 parent c2b3392 commit e76e96d

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

YUViewApp/YUViewApp.pro

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@ QT += core gui widgets opengl xml concurrent network
22

33
TARGET = YUView
44
TEMPLATE = app
5-
CONFIG += c++20
65
CONFIG -= debug_and_release
76

7+
CONFIG += c++20
8+
gcc {
9+
# For gcc 9, setting 20 does not work. Must set c++2a.
10+
equals(QMAKE_GCC_MAJOR_VERSION, 9): QMAKE_CXXFLAGS += -std=c++2a
11+
}
12+
813
SOURCES += $$files(src/*.cpp, false)
914
HEADERS += $$files(src/*.h, false)
1015

YUViewLib/YUViewLib.pro

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,15 @@ QT += core gui widgets opengl xml concurrent network
22

33
TEMPLATE = lib
44
CONFIG += staticlib
5-
CONFIG += c++20
65
CONFIG -= debug_and_release
76
CONFIG += object_parallel_to_source
87

8+
CONFIG += c++20
9+
gcc {
10+
# For gcc 9, setting 20 does not work. Must set c++2a.
11+
equals(QMAKE_GCC_MAJOR_VERSION, 9): QMAKE_CXXFLAGS += -std=c++2a
12+
}
13+
914
SOURCES += $$files(src/*.cpp, true)
1015
HEADERS += $$files(src/*.h, true)
1116

YUViewUnitTest/YUViewUnitTest.pro

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@ TEMPLATE = app
66
CONFIG += console
77
CONFIG -= app_bundle
88
CONFIG -= debug_and_release
9+
910
CONFIG += c++20
11+
gcc {
12+
# For gcc 9, setting 20 does not work. Must set c++2a.
13+
equals(QMAKE_GCC_MAJOR_VERSION, 9): QMAKE_CXXFLAGS += -std=c++2a
14+
}
1015

1116
SOURCES += $$files(*.cpp, true)
1217
HEADERS += $$files(*.h, true)

0 commit comments

Comments
 (0)