From 34b42d2354f443b2678cb4c564e93dd8236665c3 Mon Sep 17 00:00:00 2001 From: nhmall Date: Sun, 29 Jun 2025 11:59:07 -0400 Subject: [PATCH] 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 --- sys/unix/hints/include/compiler.370 | 14 ++++++++++++++ sys/unix/hints/include/multiw-2.370 | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/sys/unix/hints/include/compiler.370 b/sys/unix/hints/include/compiler.370 index 62486d3ad..5ef6f801e 100755 --- a/sys/unix/hints/include/compiler.370 +++ b/sys/unix/hints/include/compiler.370 @@ -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 diff --git a/sys/unix/hints/include/multiw-2.370 b/sys/unix/hints/include/multiw-2.370 index 073cc9c20..c580063b6 100644 --- a/sys/unix/hints/include/multiw-2.370 +++ b/sys/unix/hints/include/multiw-2.370 @@ -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