From 4dc5a8cf875504f253032a35407ef59f298cd9b5 Mon Sep 17 00:00:00 2001 From: florian-simvia Date: Wed, 19 Aug 2026 07:34:49 +0200 Subject: [PATCH] Fix macOS build : Apple clang C++17 flag and PyQt6 tools detection. Apple clang version numbers don't follow the LLVM's and its default standard is still C++14, so the version test in cs_auto_flag.sh missed it and compilation stopped on std::is_same_v in cs_defs.h. Force -std=c++17 when the compiler identifies as Apple. In configure.ac, a typo ("xPyQt5" instead of "xPyQt6") disabled the detection of the PyQt6 dev tools, so GUI builds with PyQt6 failed with "--pyrcc must be set". Affects Linux too, not just macOS. configure must be regenerated with ./sbin/bootstrap. --- config/cs_auto_flags.sh | 11 ++++++++++- configure.ac | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/config/cs_auto_flags.sh b/config/cs_auto_flags.sh index d02f2cf154..562a237142 100644 --- a/config/cs_auto_flags.sh +++ b/config/cs_auto_flags.sh @@ -751,10 +751,19 @@ elif test "x$cs_gxx" = "xclang"; then cxxflags_default_omp="-fopenmp=libomp" cs_clangpp_version_number=`echo $cs_ac_cxx_version | sed -e "s/^.*version //"` - case "$cs_clangpp_version_number" in + case "$cs_ac_cxx_version" in + *Apple*) + # Apple clang version numbers do not match LLVM ones, and the + # default C++ standard remains C++14 in recent versions. + cxxflags_default="$cxxflags_default -std=c++17" + ;; + *) + case "$cs_clangpp_version_number" in 14* | 15*) cxxflags_default="$cxxflags_default -std=c++17" ;; + esac + ;; esac case "$cs_clangpp_version_number" in 14* | 15* | 16* | 17* | 18* | 19* | 2*) diff --git a/configure.ac b/configure.ac index a947073c08..7bf7100f07 100644 --- a/configure.ac +++ b/configure.ac @@ -1107,7 +1107,7 @@ sys.exit(0)]" fi # Test for PyQt6 developer tools - if test "x$cs_have_gui" = "xPyQt5" ; then + if test "x$cs_have_gui" = "xPyQt6" ; then # Try to find PyQt6 tools through Python interpreter prog="[import os, sys