recent qt6 requires c++20

There are warnings within the qt6 header files if c++20 is not used, for example:

usr/include/x86_64-linux-gnu/qt6/QtCore/qfuturesynchronizer.h:21:5: warning: use of the 'nodiscard' attribute is a C++20 extension [-Wc++20-attribute-extensions]
   21 |     Q_NODISCARD_CTOR_X("Use future.waitForFinished() instead.")
      |     ^
/usr/include/x86_64-linux-gnu/qt6/QtCore/qcompilerdetection.h:972:43: note: expanded from macro 'Q_NODISCARD_CTOR_X'
  972 | #    define Q_NODISCARD_CTOR_X(message) [[nodiscard(message)]]
      |                                           ^
1 warning generated.

qmake6 --version
QMake version 3.1
Using Qt version 6.8.3 in /usr/lib/x86_64-linux-gnu
This commit is contained in:
nhmall
2025-06-29 11:59:07 -04:00
parent 8d8867007f
commit 34b42d2354
2 changed files with 15 additions and 1 deletions

View File

@@ -26,6 +26,7 @@ CCFLAGS = -g
# If these are set on entry, preparation for C++ compiles is affected.
# CPLUSPLUS_NEEDED = 1 C++ compile bits included
# CPLUSPLUS_NEED17 = 1 C++ -std=c++17 (at least)
# CPLUSPLUS_NEED20 = 1 C++ -std=c++20 (at least)
# CPLUSPLUS_NEED_DEPSUPPRESS = 1 C++ -Wno-deprecated-copy,
# -Wno-deprecated-declarations
@@ -149,6 +150,14 @@ else # g++ version greater than or equal to 12? (no follows)
CCXX=g++ -std=c++17
endif # g++ version greater than or equal to 12
endif # CPLUSPLUS_NEED17
ifdef CPLUSPLUS_NEED20
ifeq "$(GPPGTEQ9)" "1"
CCXX=g++ -std=c++20
else # g++ version greater than or equal to 9? (no follows)
CCXX=g++ -std=c++17
endif # g++ version greater than or equal to 9
endif # CPLUSPLUS_NEED20
else # g++ or clang++ ?
@@ -183,6 +192,11 @@ ifeq "$(CLANGPPGTEQ17)" "1"
CCXX=clang++ -std=c++17
endif # clang++ greater than or equal to 17
endif # CPLUSPLUS_NEED17
ifdef CPLUSPLUS_NEED20
ifeq "$(CLANGPPGTEQ17)" "1"
CCXX=clang++ -std=c++20
endif # clang++ greater than or equal to 17
endif # CPLUSPLUS_NEED20
endif # end of clang++-specific section
CXX=$(CCXX)
endif # CPLUSPLUS_NEEDED

View File

@@ -163,7 +163,7 @@ ifndef CPLUSPLUS_NEEDED
CPLUSPLUS_NEEDED = 1
endif # CPLUSPLUS_NEEDED
ifdef WANT_WIN_QT6
CPLUSPLUS_NEED17 = 1
CPLUSPLUS_NEED20 = 1
CPLUSPLUS_NEED_DEPSUPPRESS = 1
endif # WANT_WIN_QT6
endif # WANT_WIN_QT