Skip to content

Commit

Permalink
Force c++20 when building Natron.
Browse files Browse the repository at this point in the history
  • Loading branch information
acolwell committed Sep 16, 2023
1 parent 19e6892 commit ba5f678
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions global.pri
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tools/jenkins/build-natron.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions tools/jenkins/compiler-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}}

Expand Down

0 comments on commit ba5f678

Please sign in to comment.