Skip to content

Commit

Permalink
Upgrade to C++20
Browse files Browse the repository at this point in the history
  • Loading branch information
acolwell committed Sep 16, 2023
1 parent 0b03e24 commit 19e6892
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ project(Natron
LANGUAGES CXX C
)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 20)

option(NATRON_SYSTEM_LIBS "use system versions of dependencies instead of bundled ones" OFF)
option(NATRON_BUILD_TESTS "build the Natron test suite" ON)
Expand Down
2 changes: 1 addition & 1 deletion Engine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ set(PYENGINE_HEADER PySide2_Engine_Python.h)
set(POST_SHIBOKEN ../tools/utils/runPostShiboken2.sh)

set(shiboken_args
"--enable-parent-ctor-heuristic" "--use-isnull-as-nb_nonzero"
"-std=c++20" "--enable-parent-ctor-heuristic" "--use-isnull-as-nb_nonzero"
"--avoid-protected-hack" "--enable-pyside-extensions"
"-I." "-I.." "-I../Global" "-I../libs/OpenFX/include" ${PYENGINE_INCS}
"-T${PYSIDE_TYPESYSTEMS}" "--output-directory=${PYENGINE_OUT}"
Expand Down
2 changes: 1 addition & 1 deletion Gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ set(PYGUI_HEADER PySide2_Gui_Python.h)
set(POST_SHIBOKEN ../tools/utils/runPostShiboken2.sh)

set(shiboken_args
"--enable-parent-ctor-heuristic" "--use-isnull-as-nb_nonzero"
"-std=c++20" "--enable-parent-ctor-heuristic" "--use-isnull-as-nb_nonzero"
"--avoid-protected-hack" "--enable-pyside-extensions"
${PYGUI_INCS}
"-T../Engine" "-T${PYSIDE_TYPESYSTEMS}" "--output-directory=${PYGUI_OUT}"
Expand Down
32 changes: 16 additions & 16 deletions global.pri
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# along with Natron. If not, see <http://www.gnu.org/licenses/gpl-2.0.html>
# ***** END LICENSE BLOCK *****

CONFIG += c++11 c++14
CONFIG += c++11 c++20

# libs may modify the config (eg openmp), so it must be included before
include(libs.pri)
Expand Down Expand Up @@ -309,10 +309,10 @@ macx-clang-libc++ {
QMAKE_OBJECTIVE_CFLAGS += -mmacosx-version-min=$$QMAKE_MACOSX_DEPLOYMENT_TARGET
QMAKE_OBJECTIVE_CXXFLAGS += -stdlib=libc++ -mmacosx-version-min=$$QMAKE_MACOSX_DEPLOYMENT_TARGET
c++11 {
c++14 {
QMAKE_OBJECTIVE_CXXFLAGS += -std=c++14
c++20 {
QMAKE_OBJECTIVE_CXXFLAGS += -std=c++20
}
!c++14 {
!c++20 {
QMAKE_OBJECTIVE_CXXFLAGS += -std=c++11
}
}
Expand All @@ -323,10 +323,10 @@ macx-clang {
QMAKE_OBJECTIVE_CFLAGS += -mmacosx-version-min=$$QMAKE_MACOSX_DEPLOYMENT_TARGET
QMAKE_OBJECTIVE_CXXFLAGS += -mmacosx-version-min=$$QMAKE_MACOSX_DEPLOYMENT_TARGET
c++11 {
c++14 {
QMAKE_OBJECTIVE_CXXFLAGS += -std=c++14
c++20 {
QMAKE_OBJECTIVE_CXXFLAGS += -std=c++20
}
!c++14 {
!c++20 {
QMAKE_OBJECTIVE_CXXFLAGS += -std=c++11
}
}
Expand Down Expand Up @@ -528,13 +528,13 @@ unix {
symbols_hidden_by_default.value = YES
QMAKE_MAC_XCODE_SETTINGS += symbols_hidden_by_default
c++11 {
c++14 {
QMAKE_CXXFLAGS += -std=c++14
enable_cxx14.name = CLANG_CXX_LANGUAGE_STANDARD
enable_cxx14.value = c++14
QMAKE_MAC_XCODE_SETTINGS += enable_cxx14
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
}
!c++14 {
!c++20 {
QMAKE_CXXFLAGS += -std=c++11
enable_cxx11.name = CLANG_CXX_LANGUAGE_STANDARD
enable_cxx11.value = c++0x
Expand All @@ -547,10 +547,10 @@ unix {
QMAKE_CXXFLAGS += -ftemplate-depth-1024
QMAKE_CXXFLAGS_WARN_ON += -Wno-c++11-extensions
c++11 {
c++14 {
QMAKE_CXXFLAGS += -std=c++14
c++20 {
QMAKE_CXXFLAGS += -std=c++20
}
!c++14 {
!c++20 {
QMAKE_CXXFLAGS += -std=c++11
}
}
Expand Down
8 changes: 4 additions & 4 deletions tools/jenkins/build-natron.sh
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ fi
if [ "$NO_BUILD" != "1" ] && ([ "${SDK_VERSION:-}" = "CY2016" ] || [ "${SDK_VERSION:-}" = "CY2017" ]); then
cat "$INC_PATH/natron/${SDK_VERSION}.pri" > config.pri
rm -f Engine/NatronEngine/* Gui/NatronGui/*
shiboken --avoid-protected-hack --enable-pyside-extensions --include-paths="../Engine:../Global:${SDK_HOME}/include:${SDK_HOME}/include/PySide2" --typesystem-paths="${SDK_HOME}/share/PySide2/typesystems" --output-directory=Engine Engine/Pyside_Engine_Python.h Engine/typesystem_engine.xml
shiboken --avoid-protected-hack --enable-pyside-extensions --include-paths="../Engine:../Gui:../Global:${SDK_HOME}/include:${SDK_HOME}/include/PySide2" --typesystem-paths="${SDK_HOME}/share/PySide2/typesystems:Engine" --output-directory=Gui Gui/Pyside_Gui_Python.h Gui/typesystem_natronGui.xml
shiboken -std=c++20 --avoid-protected-hack --enable-pyside-extensions --include-paths="../Engine:../Global:${SDK_HOME}/include:${SDK_HOME}/include/PySide2" --typesystem-paths="${SDK_HOME}/share/PySide2/typesystems" --output-directory=Engine Engine/Pyside_Engine_Python.h Engine/typesystem_engine.xml
shiboken -std=c++20 --avoid-protected-hack --enable-pyside-extensions --include-paths="../Engine:../Gui:../Global:${SDK_HOME}/include:${SDK_HOME}/include/PySide2" --typesystem-paths="${SDK_HOME}/share/PySide2/typesystems:Engine" --output-directory=Gui Gui/Pyside_Gui_Python.h Gui/typesystem_natronGui.xml
sh tools/utils/runPostShiboken.sh
fi

Expand Down Expand Up @@ -175,9 +175,9 @@ if [ "$QT_VERSION_MAJOR" = 5 ]; then
rm Engine/Qt${QT_VERSION_MAJOR}/NatronEngine/* Gui/Qt${QT_VERSION_MAJOR}/NatronGui/* || true
SHIBOKEN_INCLUDE_PATHS=".:./Engine:./Global:libs/OpenFX/include:${UNIX_SDK_HOME}/include:${QTDIR}/include:${UNIX_PYTHON_HOME}/include/python${PYVER}:${UNIX_PYTHON_HOME}/include/PySide2:${UNIX_PYTHON_HOME}/lib/python${PYVER}/site-packages/PySide2/include"
SHIBOKEN_TYPESYSTEM_PATHS="${UNIX_PYTHON_HOME}/share/PySide2/typesystems:${UNIX_PYTHON_HOME}/lib/python${PYVER}/site-packages/PySide2/typesystems"
shiboken2 --avoid-protected-hack --enable-pyside-extensions --include-paths=${SHIBOKEN_INCLUDE_PATHS} --typesystem-paths=${SHIBOKEN_TYPESYSTEM_PATHS} --output-directory=Engine/Qt${QT_VERSION_MAJOR} Engine/Pyside2_Engine_Python.h Engine/typesystem_engine.xml
shiboken2 -std=c++20 --avoid-protected-hack --enable-pyside-extensions --include-paths=${SHIBOKEN_INCLUDE_PATHS} --typesystem-paths=${SHIBOKEN_TYPESYSTEM_PATHS} --output-directory=Engine/Qt${QT_VERSION_MAJOR} Engine/Pyside2_Engine_Python.h Engine/typesystem_engine.xml

shiboken2 --avoid-protected-hack --enable-pyside-extensions --include-paths=${SHIBOKEN_INCLUDE_PATHS}:${QTDIR}/include/QtWidgets:${QTDIR}/include/QtCore --typesystem-paths=${SHIBOKEN_TYPESYSTEM_PATHS}:./Engine:./Shiboken --output-directory=Gui/Qt${QT_VERSION_MAJOR} Gui/Pyside2_Gui_Python.h Gui/typesystem_natronGui.xml
shiboken2 -std=c++20 --avoid-protected-hack --enable-pyside-extensions --include-paths=${SHIBOKEN_INCLUDE_PATHS}:${QTDIR}/include/QtWidgets:${QTDIR}/include/QtCore --typesystem-paths=${SHIBOKEN_TYPESYSTEM_PATHS}:./Engine:./Shiboken --output-directory=Gui/Qt${QT_VERSION_MAJOR} Gui/Pyside2_Gui_Python.h Gui/typesystem_natronGui.xml

tools/utils/runPostShiboken2.sh Engine/Qt${QT_VERSION_MAJOR}/NatronEngine natronengine
tools/utils/runPostShiboken2.sh Gui/Qt${QT_VERSION_MAJOR}/NatronGui natrongui
Expand Down

0 comments on commit 19e6892

Please sign in to comment.