changeset 32357:523613891d2f

build: Avoid adding compiler flags for C++17 if Qt6 isn't available. * m4/acinclude.m4 (OCTAVE_CHECK_QT_VERSION): Move check for C++17 compiler until after it is known that Qt6 tools and packages are available.
author Markus Mützel <markus.muetzel@gmx.de>
date Wed, 27 Sep 2023 18:17:36 +0200
parents 0cdf8fe8533c
children 8f4bc20584ed
files m4/acinclude.m4
diffstat 1 files changed, 10 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/m4/acinclude.m4	Wed Sep 27 17:52:20 2023 +0200
+++ b/m4/acinclude.m4	Wed Sep 27 18:17:36 2023 +0200
@@ -2021,13 +2021,6 @@
           QT_MODULES="$QT_MODULES Qt6Core5Compat"
         ;;
       esac
-      ## Ensure that the C++ compiler fully supports C++17.
-      ## Preferably with GNU extensions if flags are required.
-      AX_CXX_COMPILE_STDCXX(17, [], optional)
-      if test $HAVE_CXX17 -eq 0; then
-        build_qt_gui=no
-        warn_qt_cxx17="compiler doesn't support C++17; disabling Qt GUI"
-      fi
     ;;
     *)
       AC_MSG_ERROR([Unrecognized Qt version $qt_version])
@@ -2199,6 +2192,16 @@
     esac
   fi
 
+  if test $build_qt_gui = yes && test "$qt_version" -eq 6; then
+    ## Ensure that the C++ compiler fully supports C++17.
+    ## Preferably with GNU extensions if flags are required.
+    AX_CXX_COMPILE_STDCXX(17, [], optional)
+    if test $HAVE_CXX17 -eq 0; then
+      build_qt_gui=no
+      warn_qt_cxx17="compiler doesn't support C++17; disabling Qt GUI"
+    fi
+  fi
+
   if test $build_qt_gui = yes; then
     ## We have what we need to build the Qt GUI.  The remaining
     ## checks below are for optional features related to the Qt GUI.