Skip to content

Commit

Permalink
build: Avoid adding compiler flags for C++17 if Qt6 isn't available.
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
mmuetzel committed Sep 27, 2023
1 parent c34dfee commit ffb8f74
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions m4/acinclude.m4
Original file line number Diff line number Diff line change
Expand Up @@ -2021,13 +2021,6 @@ AC_DEFUN([OCTAVE_CHECK_QT_VERSION], [AC_MSG_CHECKING([Qt version $1])
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])
Expand Down Expand Up @@ -2199,6 +2192,16 @@ AC_DEFUN([OCTAVE_CHECK_QT_VERSION], [AC_MSG_CHECKING([Qt version $1])
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.
Expand Down

0 comments on commit ffb8f74

Please sign in to comment.