From ba5f6783e2f6ba3bb55ff71f911c085a96b17016 Mon Sep 17 00:00:00 2001 From: Aaron Colwell <300262+acolwell@users.noreply.github.com> Date: Sat, 16 Sep 2023 16:43:46 -0700 Subject: [PATCH] Force c++20 when building Natron. --- global.pri | 6 +++--- tools/jenkins/build-natron.sh | 4 ++-- tools/jenkins/compiler-common.sh | 3 +++ 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/global.pri b/global.pri index da7052b3e..42fdbbcb0 100644 --- a/global.pri +++ b/global.pri @@ -530,9 +530,9 @@ unix { c++11 { c++20 { QMAKE_CXXFLAGS += -std=c++20 - enable_cxx17.name = CLANG_CXX_LANGUAGE_STANDARD - enable_cxx17.value = c++20 - QMAKE_MAC_XCODE_SETTINGS += enable_cxx17 + enable_cxx20.name = CLANG_CXX_LANGUAGE_STANDARD + enable_cxx20.value = c++20 + QMAKE_MAC_XCODE_SETTINGS += enable_cxx20 } !c++20 { QMAKE_CXXFLAGS += -std=c++11 diff --git a/tools/jenkins/build-natron.sh b/tools/jenkins/build-natron.sh index ca131e1e1..1c79b13df 100755 --- a/tools/jenkins/build-natron.sh +++ b/tools/jenkins/build-natron.sh @@ -290,8 +290,8 @@ fi # build if [ "$NO_BUILD" != "1" ]; then printStatusMessage "Building Natron..." - echo "env CFLAGS=\"${BF:-}\" CXXFLAGS=\"${BF:-}\" \"$QMAKE\" -r CONFIG+=\"$COMPILE_TYPE\" QMAKE_CC=\"$CC\" QMAKE_CXX=\"$CXX\" QMAKE_LINK=\"$CXX\" QMAKE_OBJECTIVE_CC=\"$OBJECTIVE_CC\" QMAKE_OBJECTIVE_CXX=\"$OBJECTIVE_CXX\" ${QMAKE_FLAGS_EXTRA[*]} ${PYO:-} ../Project.pro" - env CFLAGS="${BF:-}" CXXFLAGS="${BF:-}" "$QMAKE" -r CONFIG+="$COMPILE_TYPE" QMAKE_CC="$CC" QMAKE_CXX="$CXX" QMAKE_LINK="$CXX" QMAKE_OBJECTIVE_CC="$OBJECTIVE_CC" QMAKE_OBJECTIVE_CXX="$OBJECTIVE_CXX" "${QMAKE_FLAGS_EXTRA[@]}" ${PYO:-} "$srcdir"/Project.pro + echo "env CFLAGS=\"${BF:-}\" CXXFLAGS=\"${BF:-}\" \"$QMAKE\" -r CONFIG+=\"$COMPILE_TYPE\" QMAKE_CC=\"$CC\" QMAKE_CXX=\"$CXX20\" QMAKE_LINK=\"$CXX\" QMAKE_OBJECTIVE_CC=\"$OBJECTIVE_CC\" QMAKE_OBJECTIVE_CXX=\"$OBJECTIVE_CXX\" ${QMAKE_FLAGS_EXTRA[*]} ${PYO:-} ../Project.pro" + env CFLAGS="${BF:-}" CXXFLAGS="${BF:-}" "$QMAKE" -r CONFIG+="$COMPILE_TYPE" QMAKE_CC="$CC" QMAKE_CXX="$CXX20" QMAKE_LINK="$CXX20" QMAKE_OBJECTIVE_CC="$OBJECTIVE_CC" QMAKE_OBJECTIVE_CXX="$OBJECTIVE_CXX" "${QMAKE_FLAGS_EXTRA[@]}" ${PYO:-} "$srcdir"/Project.pro make -j"${MKJOBS}" make -j"${MKJOBS}" -C Tests if [ "$PKGOS" = "OSX" ]; then diff --git a/tools/jenkins/compiler-common.sh b/tools/jenkins/compiler-common.sh index 534cf2e20..fd2d9886d 100644 --- a/tools/jenkins/compiler-common.sh +++ b/tools/jenkins/compiler-common.sh @@ -6,11 +6,13 @@ set -u # Treat unset variables as an error when substituting. STD14="c++14" STD17="c++17" +STD20="c++20" # https://stackoverflow.com/a/42232124 if [ "$PKGOS" = "Windows" ]; then STD14="gnu++14" STD17="gnu++17" + STD20="gnu++20" fi if [ "$PKGOS" = "OSX" ]; then @@ -205,6 +207,7 @@ COMPILER=${COMPILER:-gcc} CC=${CC:-gcc} CXX=${CXX:-g++ -std=${STD14}} CXX17=${CXX17:-g++ -std=${STD17}} +CXX20=${CXX20:-g++ -std=${STD20}} OBJECTIVE_CC=${OBJECTIVE_CC:-${CC}} OBJECTIVE_CXX=${OBJECTIVE_CXX:-${CXX}}