Skip to content

Commit

Permalink
Shiboken generation in QMake
Browse files Browse the repository at this point in the history
  • Loading branch information
YakoYakoYokuYoku committed Jun 15, 2022
1 parent fb4fb84 commit c02990e
Show file tree
Hide file tree
Showing 5 changed files with 154 additions and 109 deletions.
93 changes: 40 additions & 53 deletions Engine/Engine.pro
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ SOURCES += \
../Global/PythonUtils.cpp \
../Global/StrUtils.cpp \
../libs/SequenceParsing/SequenceParsing.cpp \
$${ENGINE_WRAPPER_DIR}/natronengine_module_wrapper.cpp \

HEADERS += \
AbortableRenderInfo.h \
Expand Down Expand Up @@ -427,7 +426,9 @@ HEADERS += \
../libs/OpenFX/include/nuke/fnPublicOfxExtensions.h \
../libs/OpenFX/include/tuttle/ofxReadWrite.h \
../libs/OpenFX_extensions/ofxhParametricParam.h \
$${ENGINE_WRAPPER_DIR}/natronengine_python.h \

GENERATED_SOURCES += $${ENGINE_WRAPPER_DIR}/natronengine_module_wrapper.cpp
GENERATED_HEADERS += $${ENGINE_WRAPPER_DIR}/natronengine_python.h

ENGINE_GENERATED_SOURCES = \
animatedparam_wrapper \
Expand Down Expand Up @@ -480,67 +481,53 @@ ENGINE_GENERATED_SOURCES = \
userparamholder_wrapper \

for(name, ENGINE_GENERATED_SOURCES) {
SOURCES += $${ENGINE_WRAPPER_DIR}/$${name}.cpp
HEADERS += $${ENGINE_WRAPPER_DIR}/$${name}.h
GENERATED_SOURCES += $${ENGINE_WRAPPER_DIR}/$${name}.cpp
GENERATED_HEADERS += $${ENGINE_WRAPPER_DIR}/$${name}.h
}


OTHER_FILES += \
typesystem_engine.xml

# GENERATED_SOURCES = \
# NatronEngine/animatedparam_wrapper.cpp \
# NatronEngine/app_wrapper.cpp \
# NatronEngine/beziercurve_wrapper.cpp \
# NatronEngine/booleanparam_wrapper.cpp \
# NatronEngine/buttonparam_wrapper.cpp \
# NatronEngine/choiceparam_wrapper.cpp \
# NatronEngine/colorparam_wrapper.cpp \
# NatronEngine/colortuple_wrapper.cpp \
# NatronEngine/double2dparam_wrapper.cpp \
# NatronEngine/double2dtuple_wrapper.cpp \
# NatronEngine/double3dparam_wrapper.cpp \
# NatronEngine/double3dtuple_wrapper.cpp \
# NatronEngine/doubleparam_wrapper.cpp \
# NatronEngine/effect_wrapper.cpp \
# NatronEngine/fileparam_wrapper.cpp \
# NatronEngine/group_wrapper.cpp \
# NatronEngine/groupparam_wrapper.cpp \
# NatronEngine/int2dparam_wrapper.cpp \
# NatronEngine/int2dtuple_wrapper.cpp \
# NatronEngine/int3dparam_wrapper.cpp \
# NatronEngine/int3dtuple_wrapper.cpp \
# NatronEngine/intparam_wrapper.cpp \
# NatronEngine/itembase_wrapper.cpp \
# NatronEngine/layer_wrapper.cpp \
# NatronEngine/natron_wrapper.cpp \
# NatronEngine/natronengine_module_wrapper.cpp \
# NatronEngine/outputfileparam_wrapper.cpp \
# NatronEngine/pageparam_wrapper.cpp \
# NatronEngine/param_wrapper.cpp \
# NatronEngine/parametricparam_wrapper.cpp \
# NatronEngine/pathparam_wrapper.cpp \
# NatronEngine/roto_wrapper.cpp \
# NatronEngine/stringparam_wrapper.cpp \
# NatronEngine/stringparambase_wrapper.cpp
defineReplace(shibokenEngine) {
SOURCES += $$GENERATED_SOURCES
HEADERS += $$GENERATED_HEADERS
return("%_wrapper.cpp")
}

# defineReplace(shibokenWorkaround) {
# SOURCES += $$GENERATED_SOURCES
# return("%_wrapper.cpp")
# }
QT_INCLUDEPATH = $$PYTHON_INCLUDEPATH $$PYSIDE_INCLUDEDIR
for(dep, QT) {
QT_INCLUDEPATH += $$eval(QT.$${dep}.includes)
QT_INCLUDEPATH += $$absolute_path($$eval(QT.$${dep}.name), $$PYSIDE_INCLUDEDIR)
}

equals(QT_MAJOR_VERSION, 5) {
PYENGINE_HEADER = PySide2_Engine_Python.h
POST_SHIBOKEN = bash $$shell_path(../tools/utils/runPostShiboken2.sh)
} else:equals(QT_MAJOR_VERSION, 4) {
PYENGINE_HEADER = Pyside_Engine_Python.h
POST_SHIBOKEN = bash $$shell_path(../tools/utils/runPostShiboken.sh)
}

# isEmpty(SHIBOKEN) {
# SHIBOKEN = shiboken
# }
SRC_PATH = $$relative_path($$PWD, $$OUT_PWD)/
DEP_GROUP = $$PYENGINE_HEADER typesystem_engine.xml $$HEADERS
enginesbk.input = $$PYENGINE_HEADER typesystem_engine.xml
enginesbk.depends = $$eval($$list($$join(DEP_GROUP, " "$$SRC_PATH, $$SRC_PATH)))
enginesbk.target = enginesbk
enginesbk.commands = cd $$PWD && $$SHIBOKEN \
--enable-parent-ctor-heuristic --use-isnull-as-nb_nonzero \
--avoid-protected-hack --enable-pyside-extensions \
-I.:..:../Global:../libs/OpenFX/include $$join(QT_INCLUDEPATH, ":", "-I") \
-T$$TYPESYSTEMPATH --output-directory=$$OUT_PWD/Qt$$QT_MAJOR_VERSION \
$$PYENGINE_HEADER typesystem_engine.xml && \
$$POST_SHIBOKEN $$OUT_PWD/Qt$$QT_MAJOR_VERSION/NatronEngine natronengine
pyengine.depends = enginesbk
pyengine.target = $$shell_path($$ENGINE_WRAPPER_DIR/%_wrapper.cpp)
pyengine.output_function = shibokenEngine
pyengine.commands = bash -c 'true'

# SHIBOKEN_FILE = . # Need to give some bogus input
# SHIBOKEN.input = SHIBOKEN_FILE
# SHIBOKEN.output_function = shibokenWorkaround
# SHIBOKEN.commands = $$SHIBOKEN --include-paths=..:$$system(pkg-config --variable=includedir pyside) --typesystem-paths=$$system(pkg-config --variable=typesystemdir pyside) Pyside_Engine_Python.h typesystem_engine.xml
# SHIBOKEN.CONFIG = no_link # don't add the .cpp target file to OBJECTS
# SHIBOKEN.clean = dummy # don't remove the %_wrapper.cpp file by "make clean"
QMAKE_EXTRA_TARGETS += enginesbk pyengine

# QMAKE_EXTRA_COMPILERS += SHIBOKEN
macx {

OBJECTIVE_SOURCES += \
Expand Down
49 changes: 45 additions & 4 deletions Gui/Gui.pro
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ SOURCES += \
ViewerTabPrivate.cpp \
ViewerToolButton.cpp \
ticks.cpp \
$${GUI_WRAPPER_DIR}/natrongui_module_wrapper.cpp \

HEADERS += \
AboutWindow.h \
Expand Down Expand Up @@ -384,7 +383,9 @@ HEADERS += \
../libs/OpenFX/include/nuke/fnPublicOfxExtensions.h \
../libs/OpenFX/include/tuttle/ofxReadWrite.h \
../libs/OpenFX_extensions/ofxhParametricParam.h \
$${GUI_WRAPPER_DIR}/natrongui_python.h \

GENERATED_SOURCES += $${GUI_WRAPPER_DIR}/natrongui_module_wrapper.cpp
GENERATED_HEADERS += $${GUI_WRAPPER_DIR}/natrongui_python.h

GUI_GENERATED_SOURCES = \
guiapp_wrapper \
Expand All @@ -395,8 +396,8 @@ GUI_GENERATED_SOURCES = \
pyviewer_wrapper

for(name, GUI_GENERATED_SOURCES) {
SOURCES += $${GUI_WRAPPER_DIR}/$${name}.cpp
HEADERS += $${GUI_WRAPPER_DIR}/$${name}.h
GENERATED_SOURCES += $${GUI_WRAPPER_DIR}/$${name}.cpp
GENERATED_HEADERS += $${GUI_WRAPPER_DIR}/$${name}.h
}

RESOURCES += \
Expand All @@ -420,6 +421,46 @@ OTHER_FILES += \
Resources/Images/searchSize.png \
Resources/Images/splashscreen.svg

defineReplace(shibokenGui) {
SOURCES += $$GENERATED_SOURCES
HEADERS += $$GENERATED_HEADERS
return("%_wrapper.cpp")
}

QT_INCLUDEPATH = $$PYTHON_INCLUDEPATH $$PYSIDE_INCLUDEDIR
for(dep, QT) {
QT_INCLUDEPATH += $$eval(QT.$${dep}.includes)
QT_INCLUDEPATH += $$absolute_path($$eval(QT.$${dep}.name), $$PYSIDE_INCLUDEDIR)
}

equals(QT_MAJOR_VERSION, 5) {
PYGUI_HEADER = PySide2_Gui_Python.h
POST_SHIBOKEN = bash $$shell_path($$PWD/../tools/utils/runPostShiboken2.sh)
} else:equals(QT_MAJOR_VERSION, 4) {
PYGUI_HEADER = Pyside_Gui_Python.h
POST_SHIBOKEN = bash $$shell_path($$PWD/../tools/utils/runPostShiboken.sh)
}


SRC_PATH = $$relative_path($$PWD, $$OUT_PWD)/
DEP_GROUP = $$PYGUI_HEADER typesystem_natronGui.xml $$HEADERS
guisbk.input = $$PYGUI_HEADER typesystem_natronGui.xml
guisbk.depends = $$eval($$list($$join(DEP_GROUP, " "$$SRC_PATH, $$SRC_PATH)))
guisbk.target = guisbk
guisbk.commands = cd $$PWD && $$SHIBOKEN \
--enable-parent-ctor-heuristic --use-isnull-as-nb_nonzero \
--avoid-protected-hack --enable-pyside-extensions \
-I.:..:../Global:../Engine:../libs/OpenFX/include $$join(QT_INCLUDEPATH, ":", "-I") \
-T../Engine:$$TYPESYSTEMPATH --output-directory=$$OUT_PWD/Qt$$QT_MAJOR_VERSION \
$$PYGUI_HEADER typesystem_natronGui.xml && \
$$POST_SHIBOKEN $$OUT_PWD/Qt$$QT_MAJOR_VERSION/NatronGui natrongui
pygui.depends = guisbk
pygui.target = $$shell_path($$GUI_WRAPPER_DIR/%_wrapper.cpp)
pygui.output_function = shibokenGui
pygui.commands = bash -c 'true'

QMAKE_EXTRA_TARGETS += guisbk pygui

macx {
HEADERS += TaskBarMac.h
OBJECTIVE_SOURCES += \
Expand Down
10 changes: 10 additions & 0 deletions global.pri
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ DEFINES += OFX_SUPPORTS_DIALOG
#for QString(const char*) assumes ASCII strings, we may run into troubles
DEFINES += QT_NO_CAST_FROM_ASCII

greaterThan(QT_MAJOR_VERSION, 4): CONFIG += python3

# To run Natron without Python functionnalities (for debug purposes)
run-without-python {
message("Natron will run (not build) without Python")
Expand Down Expand Up @@ -402,17 +404,21 @@ win32-g++ {
cairo: PKGCONFIG += cairo fontconfig
equals(QT_MAJOR_VERSION, 5) {
shiboken: INCLUDEPATH += $$PYTHON_SITE_PACKAGES/PySide2/include/shiboken2
shiboken: SHIBOKEN = $$system(pkg-config --variable=generator_location shiboken2)
pyside: INCLUDEPATH += $$PYTHON_SITE_PACKAGES/PySide2/include/PySide2
pyside: INCLUDEPATH += $$PYTHON_SITE_PACKAGES/PySide2/include/PySide2/QtCore
pyside: INCLUDEPATH += $$PYTHON_SITE_PACKAGES/PySide2/include/PySide2/QtGui
pyside: INCLUDEPATH += $$PYTHON_SITE_PACKAGES/PySide2/include/PySide2/QtWidgets
pyside: TYPESYSTEMPATH *= $$system(pkg-config --variable=typesystemdir pyside2)
}
equals(QT_MAJOR_VERSION, 4) {
shiboken: PKGCONFIG += shiboken-py$$PYV
shiboken: SHIBOKEN = $$system(pkg-config --variable=generator_location shiboken)
pyside: PKGCONFIG += pyside-py$$PYV
PYSIDE_INCLUDEDIR = $$system(pkg-config --variable=includedir pyside-py$$PYV)
pyside: INCLUDEPATH += $$PYSIDE_INCLUDEDIR/QtCore
pyside: INCLUDEPATH += $$PYSIDE_INCLUDEDIR/QtGui
pyside: TYPESYSTEMPATH *= $$system(pkg-config --variable=typesystemdir pyside)
}
python: PKGCONFIG += python-$$PYVER$$PY_PKG_SUFFIX
boost: LIBS += -lboost_serialization-mt
Expand Down Expand Up @@ -454,12 +460,14 @@ unix {
equals(QT_MAJOR_VERSION, 5) {
system(pkg-config --exists pyside2) {
shiboken: PKGCONFIG += shiboken2
shiboken: SHIBOKEN = $$system(pkg-config --variable=generator_location shiboken2)
pyside: PKGCONFIG += pyside2
# add QtCore to includes
PYSIDE_INCLUDEDIR = $$system(pkg-config --variable=includedir pyside2)
pyside: INCLUDEPATH += $$PYSIDE_INCLUDEDIR/QtCore
pyside: INCLUDEPATH += $$PYSIDE_INCLUDEDIR/QtGui
pyside: INCLUDEPATH += $$PYSIDE_INCLUDEDIR/QtWidgets
pyside: TYPESYSTEMPATH *= $$system(pkg-config --variable=typesystemdir pyside2)
}
}

Expand All @@ -469,7 +477,9 @@ unix {
# See for example tools/travis/install_dependencies.sh for a solution that works on Linux,
# using a custom config.pri
shiboken: PKGCONFIG += shiboken
shiboken: SHIBOKEN = $$system(pkg-config --variable=generator_location shiboken)
pyside: PKGCONFIG += pyside
pyside: TYPESYSTEMPATH *= $$system(pkg-config --variable=typesystemdir pyside)
# The following hack also works with Homebrew if pyside is installed with option --with-python3
macx {
QMAKE_LFLAGS += '-Wl,-rpath,\'@loader_path/../Frameworks\''
Expand Down
61 changes: 34 additions & 27 deletions tools/utils/runPostShiboken.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,30 @@
# exit if a command returns an error status
set -e

wrapper_dir=$1
wrapper_name=$2
wrapper_source=${wrapper_name}_module_wrapper.cpp
wrapper_header=${wrapper_name}_python.h

# PySide version override, add 2 for Qt5/PySide2
PYV="$1"
PYV="$PYV"

# To be run after shiboken to fix errors

sed -e '/<destroylistener.h>/d' -i'.bak' Engine/NatronEngine/*.cpp
sed -e '/<destroylistener.h>/d' -i'.bak' Gui/NatronGui/*.cpp
sed -e "/SbkPySide${PYV}_QtCoreTypes;/d" -i'.bak' Gui/NatronGui/natrongui_module_wrapper.cpp
sed -e "/SbkPySide${PYV}_QtCoreTypeConverters;/d" -i'.bak' Gui/NatronGui/natrongui_module_wrapper.cpp
sed -e '/SbkNatronEngineTypes;/d' -i'.bak' Gui/NatronGui/natrongui_module_wrapper.cpp
sed -e '/SbkNatronEngineTypeConverters;/d' -i'.bak' Gui/NatronGui/natrongui_module_wrapper.cpp
sed -e 's/cleanTypesAttributes/cleanGuiTypesAttributes/g' -i'.bak' Gui/NatronGui/natrongui_module_wrapper.cpp
sed -e '/Py_BEGIN_ALLOW_THREADS/d' -i'.bak' Engine/NatronEngine/*.cpp
sed -e '/Py_BEGIN_ALLOW_THREADS/d' -i'.bak' Gui/NatronGui/*.cpp
sed -e '/Py_END_ALLOW_THREADS/d' -i'.bak' Engine/NatronEngine/*.cpp
sed -e '/Py_END_ALLOW_THREADS/d' -i'.bak' Gui/NatronGui/*.cpp

sed -e '/<destroylistener.h>/d' -i'.bak' $wrapper_dir/*.cpp
sed -e '/<destroylistener.h>/d' -i'.bak' $wrapper_dir/*.cpp
sed -e '/Py_BEGIN_ALLOW_THREADS/d' -i'.bak' $wrapper_dir/*.cpp
sed -e '/Py_BEGIN_ALLOW_THREADS/d' -i'.bak' $wrapper_dir/*.cpp
sed -e '/Py_END_ALLOW_THREADS/d' -i'.bak' $wrapper_dir/*.cpp
sed -e '/Py_END_ALLOW_THREADS/d' -i'.bak' $wrapper_dir/*.cpp
if [ $wrapper_name = "natrongui" ]; then
$SED -e "/SbkPySide${PYV}_QtCoreTypes;/d" -i'.bak' $wrapper_dir/$wrapper_source
$SED -e "/SbkPySide${PYV}_QtCoreTypeConverters;/d" -i'.bak' $wrapper_dir/$wrapper_source
$SED -e '/SbkNatronEngineTypes;/d' -i'.bak' $wrapper_dir/$wrapper_source
$SED -e '/SbkNatronEngineTypeConverters;/d' -i'.bak' $wrapper_dir/$wrapper_source
$SED -e 's/cleanTypesAttributes/cleanGuiTypesAttributes/g' -i'.bak' $wrapper_dir/$wrapper_source
fi

# fix warnings
sed -e 's@^#include <shiboken.h>$@#include "Global/Macros.h"\
CLANG_DIAG_OFF(mismatched-tags)\
Expand All @@ -45,48 +52,48 @@ GCC_DIAG_OFF(missing-field-initializers)\
GCC_DIAG_OFF(missing-declarations)\
GCC_DIAG_OFF(uninitialized)\
GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF\
#include <shiboken.h> // produces many warnings@' -i'.bak' Engine/NatronEngine/*.cpp Gui/NatronGui/*.cpp
#include <shiboken.h> // produces many warnings@' -i'.bak' $wrapper_dir/*.cpp

sed -e 's@// Extra includes@// Extra includes\
NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING@' -i'.bak' Engine/NatronEngine/*.cpp Gui/NatronGui/*.cpp
NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING@' -i'.bak' $wrapper_dir/*.cpp

# replace NATRON_NAMESPACE with Natron for enums with flags (e.g. StandardButtonEnum)
sed -e 's@"NatronEngine\.NATRON_NAMESPACE@"NatronEngine.Natron@g' -e 's@, NatronEngine\.NATRON_NAMESPACE@, NatronEngine.Natron@g' -e 's@"NatronGui\.NATRON_NAMESPACE@"NatronGui.Natron@g' -e 's@"NATRON_NAMESPACE@"Natron@g' -i'.bak' Engine/NatronEngine/*_wrapper.cpp
sed -e 's@"NatronEngine\.NATRON_NAMESPACE@"NatronEngine.Natron@g' -e 's@, NatronEngine\.NATRON_NAMESPACE@, NatronEngine.Natron@g' -e 's@"NatronGui\.NATRON_NAMESPACE@"NatronGui.Natron@g' -e 's@"NATRON_NAMESPACE@"Natron@g' -i'.bak' $wrapper_dir/*_wrapper.cpp

# re-add the Natron namespace
#sed -e 's@" ::\([^s][^t][^d]\)@ NATRON_NAMESPACE::\1@g' -i'.bak' Engine/NatronEngine/*.cpp Engine/NatronEngine/*.h Gui/NatronGui/*.cpp Gui/NatronGui/*.h

sed -e 's@SbkType< ::@SbkType<NATRON_NAMESPACE::NATRON_PYTHON_NAMESPACE::@g' -e 's@SbkType<NATRON_NAMESPACE::NATRON_PYTHON_NAMESPACE::QFlags<@SbkType< ::QFlags<NATRON_NAMESPACE::NATRON_PYTHON_NAMESPACE::@g' -e's@NATRON_NAMESPACE::NATRON_PYTHON_NAMESPACE::Rect@NATRON_NAMESPACE::Rect@g' -i'.bak' Engine/NatronEngine/natronengine_python.h Gui/NatronGui/natrongui_python.h
sed -e 's@SbkType< ::@SbkType<NATRON_NAMESPACE::NATRON_PYTHON_NAMESPACE::@g' -e 's@SbkType<NATRON_NAMESPACE::NATRON_PYTHON_NAMESPACE::QFlags<@SbkType< ::QFlags<NATRON_NAMESPACE::NATRON_PYTHON_NAMESPACE::@g' -e's@NATRON_NAMESPACE::NATRON_PYTHON_NAMESPACE::Rect@NATRON_NAMESPACE::Rect@g' -i'.bak' $wrapper_dir/$wrapper_header
sed -e 's@^class @NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER\
class @g' -e 's@^};@};\
NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT@g' -i'.bak' Engine/NatronEngine/*.h Gui/NatronGui/*.h
NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT@g' -i'.bak' $wrapper_dir/*.h

# replace NATRON_NAMESPACE::NATRON_NAMESPACE with NATRON_NAMESPACE in the enums wrappers
sed -e 's@NATRON_NAMESPACE::NATRON_PYTHON_NAMESPACE::NATRON_NAMESPACE@NATRON_NAMESPACE@g' -i'.bak' Engine/NatronEngine/natronengine_python.h Gui/NatronGui/natrongui_python.h
sed -e 's@NATRON_NAMESPACE::NATRON_PYTHON_NAMESPACE::NATRON_ENUM@NATRON_ENUM@g' -i'.bak' Engine/NatronEngine/natronengine_python.h Gui/NatronGui/natrongui_python.h
sed -e 's@NATRON_NAMESPACE::NATRON_PYTHON_NAMESPACE::NATRON_NAMESPACE@NATRON_NAMESPACE@g' -i'.bak' $wrapper_dir/$wrapper_header
sed -e 's@NATRON_NAMESPACE::NATRON_PYTHON_NAMESPACE::NATRON_ENUM@NATRON_ENUM@g' -i'.bak' $wrapper_dir/$wrapper_header

perl -pe 'BEGIN{undef $/;} s/ \{\n.*SnakeOil(.*\n)*.*SnakeOil.*\n }//g;' -i'.bak' Gui/NatronGui/natrongui_module_wrapper.cpp
sed -e '/SnakeOil/d' -i'.bak' Gui/NatronGui/natrongui_module_wrapper.cpp
sed -e '/snakeoil_python/d' -i'.bak' Gui/NatronGui/natrongui_python.h
perl -pe 'BEGIN{undef $/;} s/ \{\n.*SnakeOil(.*\n)*.*SnakeOil.*\n }//g;' -i'.bak' $wrapper_dir/$wrapper_source
sed -e '/SnakeOil/d' -i'.bak' $wrapper_dir/$wrapper_source
sed -e '/snakeoil_python/d' -i'.bak' $wrapper_dir/$wrapper_header

sed -e 's@^#include <pysidemetafunction.h>$@CLANG_DIAG_OFF(header-guard)\
#include <pysidemetafunction.h> // has wrong header guards in pyside 1.2.2@' -i'.bak' Engine/NatronEngine/*.cpp Gui/NatronGui/*.cpp
#include <pysidemetafunction.h> // has wrong header guards in pyside 1.2.2@' -i'.bak' $wrapper_dir/*.cpp

sed -e 's@^#include <pyside_qtcore_python.h>$@CLANG_DIAG_OFF(deprecated)\
CLANG_DIAG_OFF(uninitialized)\
CLANG_DIAG_OFF(keyword-macro)\
#include <pyside_qtcore_python.h> // produces warnings\
CLANG_DIAG_ON(deprecated)\
CLANG_DIAG_ON(uninitialized)\
CLANG_DIAG_ON(keyword-macro)@' -i'.bak' Engine/NatronEngine/*.cpp Gui/NatronGui/*.cpp Engine/NatronEngine/*.h Gui/NatronGui/*.h
CLANG_DIAG_ON(keyword-macro)@' -i'.bak' $wrapper_dir/*.cpp $wrapper_dir/*.h

sed -e 's@^#include <pyside_qtgui_python.h>$@CLANG_DIAG_OFF(deprecated)\
CLANG_DIAG_OFF(uninitialized)\
CLANG_DIAG_OFF(keyword-macro)\
#include <pyside_qtgui_python.h> // produces warnings\
CLANG_DIAG_ON(deprecated)\
CLANG_DIAG_ON(uninitialized)\
CLANG_DIAG_ON(keyword-macro)@' -i'.bak' Engine/NatronEngine/*.cpp Gui/NatronGui/*.cpp Engine/NatronEngine/*.h Gui/NatronGui/*.h
CLANG_DIAG_ON(keyword-macro)@' -i'.bak' $wrapper_dir/*.cpp $wrapper_dir/*.h

# clean up
rm Gui/NatronGui/*.bak Engine/NatronEngine/*.bak
rm $wrapper_dir/*.bak
Loading

0 comments on commit c02990e

Please sign in to comment.