Skip to content

Commit

Permalink
Add support for c++ 20 also with gcc 9
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianFeldmann committed Jan 14, 2025
1 parent c2b3392 commit e76e96d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
7 changes: 6 additions & 1 deletion YUViewApp/YUViewApp.pro
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@ QT += core gui widgets opengl xml concurrent network

TARGET = YUView
TEMPLATE = app
CONFIG += c++20
CONFIG -= debug_and_release

CONFIG += c++20
gcc {
# For gcc 9, setting 20 does not work. Must set c++2a.
equals(QMAKE_GCC_MAJOR_VERSION, 9): QMAKE_CXXFLAGS += -std=c++2a
}

SOURCES += $$files(src/*.cpp, false)
HEADERS += $$files(src/*.h, false)

Expand Down
7 changes: 6 additions & 1 deletion YUViewLib/YUViewLib.pro
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@ QT += core gui widgets opengl xml concurrent network

TEMPLATE = lib
CONFIG += staticlib
CONFIG += c++20
CONFIG -= debug_and_release
CONFIG += object_parallel_to_source

CONFIG += c++20
gcc {
# For gcc 9, setting 20 does not work. Must set c++2a.
equals(QMAKE_GCC_MAJOR_VERSION, 9): QMAKE_CXXFLAGS += -std=c++2a
}

SOURCES += $$files(src/*.cpp, true)
HEADERS += $$files(src/*.h, true)

Expand Down
5 changes: 5 additions & 0 deletions YUViewUnitTest/YUViewUnitTest.pro
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ TEMPLATE = app
CONFIG += console
CONFIG -= app_bundle
CONFIG -= debug_and_release

CONFIG += c++20
gcc {
# For gcc 9, setting 20 does not work. Must set c++2a.
equals(QMAKE_GCC_MAJOR_VERSION, 9): QMAKE_CXXFLAGS += -std=c++2a
}

SOURCES += $$files(*.cpp, true)
HEADERS += $$files(*.h, true)
Expand Down

0 comments on commit e76e96d

Please sign in to comment.