From 16f64a5acee0e06428eccd9f982531d586fdb912 Mon Sep 17 00:00:00 2001 From: baldurk Date: Mon, 25 Dec 2017 14:06:05 +0000 Subject: [PATCH] Remove use of unnecessary swig generated .py wrappers * These .py wrappers are relevant for the non-builtin path, but since we use -builtin they serve no purpose except to make things more complex. * So instead we make the module directly exported as 'module' instead of '_module'. * On windows there's no conflict because we have renderdoc.dll vs renderdoc.pyd. On linux it's librenderdoc.so vs renderdoc.so. * To prevent supporting files like .lib / .pdb from conflicting on windows we build the python modules into a subdirectory. They're not ever used by the UI (it links in the bindings directly). --- docs/conf.py | 8 +- qrenderdoc/CMakeLists.txt | 2 +- qrenderdoc/Code/pyrenderdoc/CMakeLists.txt | 21 +-- qrenderdoc/Code/pyrenderdoc/PythonContext.cpp | 93 +--------- .../pyrenderdoc/pyrenderdoc_module.vcxproj | 154 +++------------- .../pyrenderdoc/qrenderdoc_module.vcxproj | 173 +++--------------- qrenderdoc/Resources/qrenderdoc.rc | 4 - qrenderdoc/Resources/resource.h | 2 - qrenderdoc/qrenderdoc.pro | 4 - qrenderdoc/qrenderdoc_local.vcxproj | 11 +- scripts/dist.sh | 4 +- 11 files changed, 78 insertions(+), 398 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index c725b2133..44133ddcc 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -31,8 +31,12 @@ else: binpath = '../Win32/' # Prioritise release over development builds -sys.path.insert(0, os.path.abspath(binpath + 'Development')) -sys.path.insert(0, os.path.abspath(binpath + 'Release')) +sys.path.insert(0, os.path.abspath(binpath + 'Development/pymodules')) +sys.path.insert(0, os.path.abspath(binpath + 'Release/pymodules')) + +# Add the build paths to PATH so renderdoc.dll can be located +os.environ["PATH"] += os.pathsep + os.path.abspath(binpath + 'Development/') +os.environ["PATH"] += os.pathsep + os.path.abspath(binpath + 'Release/') # path to module libraries for linux sys.path.insert(0, os.path.abspath('../build/bin')) diff --git a/qrenderdoc/CMakeLists.txt b/qrenderdoc/CMakeLists.txt index 28041bd23..99e55d3f1 100644 --- a/qrenderdoc/CMakeLists.txt +++ b/qrenderdoc/CMakeLists.txt @@ -194,7 +194,7 @@ foreach(in ${swig_interfaces}) get_filename_component(swig_file ${in} NAME_WE) add_custom_command(OUTPUT ${swig_file}_python.cxx ${swig_file}.py - COMMAND ${CMAKE_BINARY_DIR}/bin/swig -v -Wextra -Werror ${SWIG_FLAGS} -O -c++ -python -modern -modernargs -enumclass -fastunpack -py3 -builtin -I${CMAKE_CURRENT_SOURCE_DIR} -I${CMAKE_SOURCE_DIR}/renderdoc/api/replay -outdir ${CMAKE_CURRENT_BINARY_DIR} -o ${CMAKE_CURRENT_BINARY_DIR}/${swig_file}_python.cxx ${CMAKE_CURRENT_SOURCE_DIR}/${in} + COMMAND ${CMAKE_BINARY_DIR}/bin/swig -v -Wextra -Werror ${SWIG_FLAGS} -O -c++ -python -modern -interface ${swig_file} -modernargs -enumclass -fastunpack -py3 -builtin -I${CMAKE_CURRENT_SOURCE_DIR} -I${CMAKE_SOURCE_DIR}/renderdoc/api/replay -outdir ${CMAKE_CURRENT_BINARY_DIR} -o ${CMAKE_CURRENT_BINARY_DIR}/${swig_file}_python.cxx ${CMAKE_CURRENT_SOURCE_DIR}/${in} DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${in} DEPENDS custom_swig DEPENDS ${RDOC_REPLAY_FILES} diff --git a/qrenderdoc/Code/pyrenderdoc/CMakeLists.txt b/qrenderdoc/Code/pyrenderdoc/CMakeLists.txt index 002e238d9..b652431c6 100644 --- a/qrenderdoc/Code/pyrenderdoc/CMakeLists.txt +++ b/qrenderdoc/Code/pyrenderdoc/CMakeLists.txt @@ -73,24 +73,15 @@ target_compile_definitions(_qrenderdoc ${MODULE_DEFINES}) target_include_directories(_qrenderdoc ${MODULE_INCLUDES}) target_link_libraries(_qrenderdoc ${MODULE_LIBRARIES}) -# Don't prefix with lib, python expects a bare .so +# Don't prefix with lib, python expects a bare .so. +# Also rename to non-underscore due to this (We couldn't call the +# python library 'renderdoc' since htat would clash with the +# prefixed target) set_target_properties(_renderdoc PROPERTIES PREFIX "") set_target_properties(_qrenderdoc PROPERTIES PREFIX "") +set_target_properties(_renderdoc PROPERTIES OUTPUT_NAME "renderdoc") +set_target_properties(_qrenderdoc PROPERTIES OUTPUT_NAME "qrenderdoc") # Make sure we build after the wrappers are generated add_dependencies(_renderdoc swig-bindings) add_dependencies(_qrenderdoc swig-bindings) - -# Copy in the .py wrappers from qrenderdoc's build -add_custom_command( - TARGET _renderdoc POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy - ${CMAKE_BINARY_DIR}/qrenderdoc/renderdoc.py - ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/renderdoc.py) - -add_custom_command( - TARGET _qrenderdoc POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy - ${CMAKE_BINARY_DIR}/qrenderdoc/qrenderdoc.py - ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/qrenderdoc.py) - diff --git a/qrenderdoc/Code/pyrenderdoc/PythonContext.cpp b/qrenderdoc/Code/pyrenderdoc/PythonContext.cpp index a0afc5139..7834aae8f 100644 --- a/qrenderdoc/Code/pyrenderdoc/PythonContext.cpp +++ b/qrenderdoc/Code/pyrenderdoc/PythonContext.cpp @@ -63,47 +63,13 @@ bool CheckCoreInterface(); bool CheckQtInterface(); // defined in SWIG-generated renderdoc_python.cpp -extern "C" PyObject *PyInit__renderdoc(void); +extern "C" PyObject *PyInit_renderdoc(void); extern "C" PyObject *PassObjectToPython(const char *type, void *obj); // this one is in qrenderdoc_python.cpp -extern "C" PyObject *PyInit__qrenderdoc(void); +extern "C" PyObject *PyInit_qrenderdoc(void); extern "C" PyObject *WrapBareQWidget(QWidget *); extern "C" QWidget *UnwrapBareQWidget(PyObject *); -#ifdef WIN32 - -// on Win32 the renderdoc.py is compiled in as a windows resource. Extract and return -#include -#include "Resources/resource.h" - -QByteArray GetResourceContents(int resource) -{ - HRSRC res = FindResource(NULL, MAKEINTRESOURCE(resource), MAKEINTRESOURCE(TYPE_EMBED)); - HGLOBAL data = LoadResource(NULL, res); - - if(!data) - return QByteArray(); - - DWORD resSize = SizeofResource(NULL, res); - const char *resData = (const char *)LockResource(data); - - return QByteArray(resData, (int)resSize); -} - -#define GetWrapperModule(name) GetResourceContents(name##_py_module) - -#else - -// Otherwise it's compiled in via include-bin which converts to a .c with extern array -extern unsigned char renderdoc_py[]; -extern unsigned int renderdoc_py_len; -extern unsigned char qrenderdoc_py[]; -extern unsigned int qrenderdoc_py_len; - -#define GetWrapperModule(name) QByteArray((const char *)name##_py, (int)name##_py_len); - -#endif - // little utility function to convert a PyObject * that we know is a string to a QString static inline QString ToQStr(PyObject *value) { @@ -229,8 +195,8 @@ void PythonContext::GlobalInit() // for the exception signal qRegisterMetaType>("QList"); - PyImport_AppendInittab("_renderdoc", &PyInit__renderdoc); - PyImport_AppendInittab("_qrenderdoc", &PyInit__qrenderdoc); + PyImport_AppendInittab("_renderdoc", &PyInit_renderdoc); + PyImport_AppendInittab("_qrenderdoc", &PyInit_qrenderdoc); #if defined(STATIC_QRENDERDOC) // add the location where our libs will be for statically-linked python installs @@ -251,43 +217,6 @@ void PythonContext::GlobalInit() PyEval_InitThreads(); - QByteArray renderdoc_py_src = GetWrapperModule(renderdoc); - - if(renderdoc_py_src.isEmpty()) - { - qCritical() << "renderdoc.py wrapper is corrupt/empty. Check build configuration to ensure " - "SWIG compiled properly with python support."; - return; - } - - QByteArray qrenderdoc_py_src = GetWrapperModule(qrenderdoc); - - if(qrenderdoc_py_src.isEmpty()) - { - qCritical() << "qrenderdoc.py wrapper is corrupt/empty. Check build configuration to ensure " - "SWIG compiled properly with python support."; - return; - } - - PyObject *renderdoc_py_compiled = - Py_CompileString(renderdoc_py_src.data(), "renderdoc.py", Py_file_input); - - if(!renderdoc_py_compiled) - { - qCritical() << "Failed to compile renderdoc.py wrapper, python will not be available"; - return; - } - - PyObject *qrenderdoc_py_compiled = - Py_CompileString(qrenderdoc_py_src.data(), "qrenderdoc.py", Py_file_input); - - if(!qrenderdoc_py_compiled) - { - Py_DecRef(renderdoc_py_compiled); - qCritical() << "Failed to compile qrenderdoc.py wrapper, python will not be available"; - return; - } - OutputRedirectorType.tp_name = "renderdoc_output_redirector"; OutputRedirectorType.tp_basicsize = sizeof(OutputRedirector); OutputRedirectorType.tp_flags = Py_TPFLAGS_DEFAULT; @@ -302,18 +231,8 @@ void PythonContext::GlobalInit() PyObject *main_module = PyImport_AddModule("__main__"); - // for compatibility with earlier versions of python that took a char * instead of const char * - char renderdoc_name[] = "renderdoc"; - char qrenderdoc_name[] = "qrenderdoc"; - - PyObject *rdoc_module = PyImport_ExecCodeModule(renderdoc_name, renderdoc_py_compiled); - PyObject *qrdoc_module = PyImport_ExecCodeModule(qrenderdoc_name, qrenderdoc_py_compiled); - - Py_XDECREF(renderdoc_py_compiled); - Py_XDECREF(qrenderdoc_py_compiled); - - PyModule_AddObject(main_module, "renderdoc", rdoc_module); - PyModule_AddObject(main_module, "qrenderdoc", qrdoc_module); + PyModule_AddObject(main_module, "renderdoc", PyImport_ImportModule("_renderdoc")); + PyModule_AddObject(main_module, "qrenderdoc", PyImport_ImportModule("_qrenderdoc")); main_dict = PyModule_GetDict(main_module); diff --git a/qrenderdoc/Code/pyrenderdoc/pyrenderdoc_module.vcxproj b/qrenderdoc/Code/pyrenderdoc/pyrenderdoc_module.vcxproj index 34d98943c..5def648a9 100644 --- a/qrenderdoc/Code/pyrenderdoc/pyrenderdoc_module.vcxproj +++ b/qrenderdoc/Code/pyrenderdoc/pyrenderdoc_module.vcxproj @@ -57,66 +57,40 @@ - - - - - - - - - - + $(SolutionDir)$(Platform)\$(Configuration)\obj\$(ProjectName)\ - + + + WIN64;%(PreprocessorDefinitions) + + + WIN64;%(PreprocessorDefinitions) + + + + + RELEASE;NDEBUG;%(PreprocessorDefinitions) + + + false - $(SolutionDir)$(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\pymodules\ $(LibraryPath) $(ExecutablePath) $(ExcludePath) - _renderdoc + renderdoc .pyd - - false - $(SolutionDir)$(Platform)\$(Configuration)\ - $(LibraryPath) - $(ExecutablePath) - $(ExcludePath) - _renderdoc - .pyd - - - true - $(SolutionDir)$(Platform)\$(Configuration)\ - $(LibraryPath) - $(ExecutablePath) - $(ExcludePath) - _renderdoc - .pyd - - - true - $(SolutionDir)$(Platform)\$(Configuration)\ - $(LibraryPath) - $(ExecutablePath) - $(ExcludePath) - _renderdoc - .pyd - - + Level4 NotUsing - MaxSpeed - true - true - RENDERDOC_PLATFORM_WIN32;WIN32;RELEASE;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + RENDERDOC_PLATFORM_WIN32;WIN32;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) false true true @@ -126,8 +100,6 @@ Windows true - true - true ..\..\3rdparty\python\$(Platform);%(AdditionalLibraryDirectories) python36.lib;%(AdditionalDependencies) @@ -136,97 +108,29 @@ true - + + + Disabled + + + - Level4 - NotUsing MaxSpeed + Default true true - RENDERDOC_PLATFORM_WIN32;WIN64;WIN32;RELEASE;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - false - true - true - /wd4100 /wd4512 - $(ProjectDir)..\..\;..\..\3rdparty\python\include;$(SolutionDir)\renderdoc\api\replay - Windows - true true true - ..\..\3rdparty\python\$(Platform);%(AdditionalLibraryDirectories) - python36.lib;%(AdditionalDependencies) - - true - - - - - Level4 - NotUsing - Disabled - false - false - RENDERDOC_PLATFORM_WIN32;WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - false - EnableFastChecks - false - false - true - true - /wd4100 /wd4512 - $(ProjectDir)..\..\;..\..\3rdparty\python\include;$(SolutionDir)\renderdoc\api\replay - - - Windows - true - false - false - Default - ..\..\3rdparty\python\$(Platform);%(AdditionalLibraryDirectories) - python36.lib;%(AdditionalDependencies) - - - true - - - - - Level4 - NotUsing - Disabled - false - false - RENDERDOC_PLATFORM_WIN32;WIN64;WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - false - EnableFastChecks - false - true - true - /wd4100 /wd4512 - $(ProjectDir)..\..\;..\..\3rdparty\python\include;$(SolutionDir)\renderdoc\api\replay - - - Windows - true - false - false - Default - ..\..\3rdparty\python\$(Platform);%(AdditionalLibraryDirectories) - python36.lib;%(AdditionalDependencies) - - - true - Document %(Fullpath);container_handling.i;pyconversion.i;cosmetics.i;$(SolutionDir)renderdoc\api\replay\basic_types.h;$(SolutionDir)renderdoc\api\replay\capture_options.h;$(SolutionDir)renderdoc\api\replay\control_types.h;$(SolutionDir)renderdoc\api\replay\d3d11_pipestate.h;$(SolutionDir)renderdoc\api\replay\d3d12_pipestate.h;$(SolutionDir)renderdoc\api\replay\data_types.h;$(SolutionDir)renderdoc\api\replay\gl_pipestate.h;$(SolutionDir)renderdoc\api\replay\renderdoc_replay.h;$(SolutionDir)renderdoc\api\replay\replay_enums.h;$(SolutionDir)renderdoc\api\replay\shader_types.h;$(SolutionDir)renderdoc\api\replay\version.h;$(SolutionDir)renderdoc\api\replay\stringise.h;$(SolutionDir)renderdoc\api\replay\structured_data.h;$(SolutionDir)renderdoc\api\replay\vk_pipestate.h;%(AdditionalInputs) - $(ProjectDir)..\..\3rdparty\swig\swig.exe -v -Wextra -Werror -O -c++ -python -modern -modernargs -enumclass -fastunpack -py3 -builtin -I$(SolutionDir)renderdoc\api\replay -outdir $(IntDir)generated -o $(IntDir)generated\%(Filename)_module_python.cxx %(FullPath) + $(ProjectDir)..\..\3rdparty\swig\swig.exe -v -Wextra -Werror -O -c++ -interface %(Filename) -python -modern -modernargs -enumclass -fastunpack -py3 -builtin -I$(SolutionDir)renderdoc\api\replay -outdir $(IntDir)generated -o $(IntDir)generated\%(Filename)_module_python.cxx %(FullPath) Compiling SWIG interface $(IntDir)generated\%(Filename).py;$(IntDir)generated\%(Filename)_module_python.cxx;%(Outputs) false @@ -241,8 +145,4 @@ - - - - diff --git a/qrenderdoc/Code/pyrenderdoc/qrenderdoc_module.vcxproj b/qrenderdoc/Code/pyrenderdoc/qrenderdoc_module.vcxproj index 4e1e377ae..dfc00e9ed 100644 --- a/qrenderdoc/Code/pyrenderdoc/qrenderdoc_module.vcxproj +++ b/qrenderdoc/Code/pyrenderdoc/qrenderdoc_module.vcxproj @@ -26,28 +26,7 @@ 8.1 - - DynamicLibrary - false - true - Unicode - v140 - - - DynamicLibrary - false - true - Unicode - v140 - - - DynamicLibrary - false - true - Unicode - v140 - - + DynamicLibrary false true @@ -57,125 +36,42 @@ - - - - - - - - - - + $(SolutionDir)$(Platform)\$(Configuration)\obj\$(ProjectName)\ - + false - $(SolutionDir)$(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\pymodules\ $(LibraryPath) $(ExecutablePath) $(ExcludePath) - _qrenderdoc + qrenderdoc .pyd - - false - $(SolutionDir)$(Platform)\$(Configuration)\ - $(LibraryPath) - $(ExecutablePath) - $(ExcludePath) - _qrenderdoc - .pyd - - - true - $(SolutionDir)$(Platform)\$(Configuration)\ - $(LibraryPath) - $(ExecutablePath) - $(ExcludePath) - _qrenderdoc - .pyd - - - true - $(SolutionDir)$(Platform)\$(Configuration)\ - $(LibraryPath) - $(ExecutablePath) - $(ExcludePath) - _qrenderdoc - .pyd - - + - Level4 - NotUsing - MaxSpeed - true - true - RENDERDOC_PLATFORM_WIN32;WIN32;RELEASE;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - false - true - true - /wd4100 /wd4512 /wd4127 - $(ProjectDir)..\..\;..\..\3rdparty\python\include;$(SolutionDir)\renderdoc\api\replay;..\..\3rdparty\qt\$(Platform)\include;..\..\3rdparty\qt\$(Platform)\include\QtWidgets;..\..\3rdparty\qt\$(Platform)\include\QtGui;..\..\3rdparty\qt\$(Platform)\include\QtCore - 4714;%(DisableSpecificWarnings) + WIN64;%(PreprocessorDefinitions) - - Windows - true - true - true - ..\..\3rdparty\python\$(Platform);..\..\3rdparty\qt\$(Platform)\lib;%(AdditionalLibraryDirectories) - python36.lib;Qt5Widgets.lib;Qt5Gui.lib;Qt5Core.lib;%(AdditionalDependencies) - - - true - true - + + WIN64;%(PreprocessorDefinitions) + - + - Level4 - NotUsing - MaxSpeed - true - true - RENDERDOC_PLATFORM_WIN32;WIN64;WIN32;RELEASE;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - false - true - true - /wd4100 /wd4512 /wd4127 - $(ProjectDir)..\..\;..\..\3rdparty\python\include;$(SolutionDir)\renderdoc\api\replay;..\..\3rdparty\qt\$(Platform)\include;..\..\3rdparty\qt\$(Platform)\include\QtWidgets;..\..\3rdparty\qt\$(Platform)\include\QtGui;..\..\3rdparty\qt\$(Platform)\include\QtCore - 4714;%(DisableSpecificWarnings) + RELEASE;QT_MESSAGELOGCONTEXT;QT_NO_DEBUG;NDEBUG;%(PreprocessorDefinitions) - - Windows - true - true - true - ..\..\3rdparty\python\$(Platform);..\..\3rdparty\qt\$(Platform)\lib;%(AdditionalLibraryDirectories) - python36.lib;Qt5Widgets.lib;Qt5Gui.lib;Qt5Core.lib;%(AdditionalDependencies) - - - true - - + Level4 NotUsing - Disabled - false - false RENDERDOC_PLATFORM_WIN32;WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) false - EnableFastChecks false - false true true /wd4100 /wd4512 /wd4127 @@ -185,8 +81,6 @@ Windows true - false - false Default ..\..\3rdparty\python\$(Platform);..\..\3rdparty\qt\$(Platform)\lib;%(AdditionalLibraryDirectories) python36.lib;Qt5Widgets.lib;Qt5Gui.lib;Qt5Core.lib;%(AdditionalDependencies) @@ -195,35 +89,22 @@ true - + - Level4 - NotUsing Disabled - false - false - RENDERDOC_PLATFORM_WIN32;WIN64;WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - false - EnableFastChecks - false - true - true - /wd4100 /wd4512 /wd4127 - $(ProjectDir)..\..\;..\..\3rdparty\python\include;$(SolutionDir)\renderdoc\api\replay;..\..\3rdparty\qt\$(Platform)\include;..\..\3rdparty\qt\$(Platform)\include\QtWidgets;..\..\3rdparty\qt\$(Platform)\include\QtGui;..\..\3rdparty\qt\$(Platform)\include\QtCore - 4714;%(DisableSpecificWarnings) + + + + + MaxSpeed + Default + true + true - Windows - true - false - false - Default - ..\..\3rdparty\python\$(Platform);..\..\3rdparty\qt\$(Platform)\lib;%(AdditionalLibraryDirectories) - python36.lib;Qt5Widgets.lib;Qt5Gui.lib;Qt5Core.lib;%(AdditionalDependencies) + true + true - - true - @@ -235,7 +116,7 @@ Document %(Fullpath);$(ProjectDir)renderdoc.i;$(SolutionDir)renderdoc\api\replay\basic_types.h;$(SolutionDir)renderdoc\api\replay\capture_options.h;$(SolutionDir)renderdoc\api\replay\control_types.h;$(SolutionDir)renderdoc\api\replay\d3d11_pipestate.h;$(SolutionDir)renderdoc\api\replay\d3d12_pipestate.h;$(SolutionDir)renderdoc\api\replay\data_types.h;$(SolutionDir)renderdoc\api\replay\gl_pipestate.h;$(SolutionDir)renderdoc\api\replay\renderdoc_replay.h;$(SolutionDir)renderdoc\api\replay\replay_enums.h;$(SolutionDir)renderdoc\api\replay\shader_types.h;$(SolutionDir)renderdoc\api\replay\version.h;$(SolutionDir)renderdoc\api\replay\vk_pipestate.h;$(ProjectDir)..\Interface\CommonPipelineState.h;$(ProjectDir)..\Interface\PersistantConfig.h;$(ProjectDir)..\Interface\RemoteHost.h;$(ProjectDir)..\Interface\QRDInterface.h;%(AdditionalInputs) - $(ProjectDir)..\..\3rdparty\swig\swig.exe -v -Wextra -Werror -O -c++ -python -modern -modernargs -enumclass -fastunpack -py3 -builtin -I$(ProjectDir)..\.. -I$(SolutionDir)renderdoc\api\replay -outdir $(IntDir)generated -o $(IntDir)generated\%(Filename)_module_python.cxx %(FullPath) + $(ProjectDir)..\..\3rdparty\swig\swig.exe -v -Wextra -Werror -O -interface %(Filename) -c++ -python -modern -modernargs -enumclass -fastunpack -py3 -builtin -I$(ProjectDir)..\.. -I$(SolutionDir)renderdoc\api\replay -outdir $(IntDir)generated -o $(IntDir)generated\%(Filename)_module_python.cxx %(FullPath) Compiling SWIG interface $(IntDir)generated\%(Filename).py;$(IntDir)generated\%(Filename)_module_python.cxx;%(Outputs) false @@ -267,8 +148,4 @@ - - - - \ No newline at end of file diff --git a/qrenderdoc/Resources/qrenderdoc.rc b/qrenderdoc/Resources/qrenderdoc.rc index a244b4159..d3e6f1f5e 100644 --- a/qrenderdoc/Resources/qrenderdoc.rc +++ b/qrenderdoc/Resources/qrenderdoc.rc @@ -99,10 +99,6 @@ BEGIN END END -// embed the renderdoc.py generated by SWIG -renderdoc_py_module TYPE_EMBED RENDERDOC_PY_PATH -qrenderdoc_py_module TYPE_EMBED QRENDERDOC_PY_PATH - ///////////////////////////////////////////////////////////////////////////// // // Icon diff --git a/qrenderdoc/Resources/resource.h b/qrenderdoc/Resources/resource.h index ef3961538..300eb1970 100644 --- a/qrenderdoc/Resources/resource.h +++ b/qrenderdoc/Resources/resource.h @@ -5,8 +5,6 @@ #include "version.h" #define TYPE_EMBED 256 -#define renderdoc_py_module 101 -#define qrenderdoc_py_module 102 // Next default values for new objects // diff --git a/qrenderdoc/qrenderdoc.pro b/qrenderdoc/qrenderdoc.pro index 0376bab41..6a394c8a6 100644 --- a/qrenderdoc/qrenderdoc.pro +++ b/qrenderdoc/qrenderdoc.pro @@ -67,10 +67,6 @@ win32 { SWIGSOURCES += Code/pyrenderdoc/renderdoc.i SWIGSOURCES += Code/pyrenderdoc/qrenderdoc.i - # Embed renderdoc.py and qrenderdoc.py - RC_DEFINES = RENDERDOC_PY_PATH=renderdoc.py - RC_DEFINES += QRENDERDOC_PY_PATH=qrenderdoc.py - # Include and link against python INCLUDEPATH += $$_PRO_FILE_PWD_/3rdparty/python/include !contains(QMAKE_TARGET.arch, x86_64) { diff --git a/qrenderdoc/qrenderdoc_local.vcxproj b/qrenderdoc/qrenderdoc_local.vcxproj index bc19b9082..318fb7d2f 100644 --- a/qrenderdoc/qrenderdoc_local.vcxproj +++ b/qrenderdoc/qrenderdoc_local.vcxproj @@ -1299,17 +1299,17 @@ Document %(Fullpath);container_handling.i;pyconversion.i;cosmetics.i;interface_check.h;$(SolutionDir)renderdoc\api\replay\basic_types.h;$(SolutionDir)renderdoc\api\replay\capture_options.h;$(SolutionDir)renderdoc\api\replay\control_types.h;$(SolutionDir)renderdoc\api\replay\d3d11_pipestate.h;$(SolutionDir)renderdoc\api\replay\d3d12_pipestate.h;$(SolutionDir)renderdoc\api\replay\data_types.h;$(SolutionDir)renderdoc\api\replay\gl_pipestate.h;$(SolutionDir)renderdoc\api\replay\renderdoc_replay.h;$(SolutionDir)renderdoc\api\replay\replay_enums.h;$(SolutionDir)renderdoc\api\replay\shader_types.h;$(SolutionDir)renderdoc\api\replay\stringise.h;$(SolutionDir)renderdoc\api\replay\structured_data.h;$(SolutionDir)renderdoc\api\replay\vk_pipestate.h;%(AdditionalInputs) - "$(ProjectDir)3rdparty\swig\swig.exe" -v -Wextra -Werror -O -c++ -python -modern -modernargs -enumclass -fastunpack -py3 -builtin -I"$(SolutionDir)renderdoc\api\replay" -outdir "$(IntDir)generated" -o "$(IntDir)generated\%(Filename)_python.cxx" "%(FullPath)" + "$(ProjectDir)3rdparty\swig\swig.exe" -v -Wextra -Werror -O -interface %(Filename) -c++ -python -modern -modernargs -enumclass -fastunpack -py3 -builtin -I"$(SolutionDir)renderdoc\api\replay" -outdir "$(IntDir)generated" -o "$(IntDir)generated\%(Filename)_python.cxx" "%(FullPath)" Compiling SWIG interface - $(IntDir)generated\%(Filename).py;$(IntDir)generated\%(Filename)_python.cxx;%(Outputs) + $(IntDir)generated\%(Filename)_python.cxx;%(Outputs) false Document - %(Fullpath);Code\Interface\QRDInterface.h;Code\Interface\CommonPipelineState.h;Code\Interface\PersistantConfig.h;Code\Interface\RemoteHost.h;$(IntDir)generated\renderdoc.py;%(AdditionalInputs) - "$(ProjectDir)3rdparty\swig\swig.exe" -v -Wextra -Werror -O -c++ -python -modern -modernargs -enumclass -fastunpack -py3 -builtin -I"$(SolutionDir)renderdoc\api\replay" -I"$(ProjectDir)." -outdir "$(IntDir)generated" -o "$(IntDir)generated\%(Filename)_python.cxx" "%(FullPath)" + %(Fullpath);Code\Interface\QRDInterface.h;Code\Interface\CommonPipelineState.h;Code\Interface\PersistantConfig.h;Code\Interface\RemoteHost.h;%(AdditionalInputs) + "$(ProjectDir)3rdparty\swig\swig.exe" -v -Wextra -Werror -O -interface %(Filename) -c++ -python -modern -modernargs -enumclass -fastunpack -py3 -builtin -I"$(SolutionDir)renderdoc\api\replay" -I"$(ProjectDir)." -outdir "$(IntDir)generated" -o "$(IntDir)generated\%(Filename)_python.cxx" "%(FullPath)" Compiling SWIG interface - $(IntDir)generated\%(Filename).py;$(IntDir)generated\%(Filename)_python.cxx;%(Outputs) + $(IntDir)generated\%(Filename)_python.cxx;%(Outputs) false @@ -1713,7 +1713,6 @@ IF %ERRORLEVEL% NEQ 0 (echo ==================================================== - RENDERDOC_PY_PATH=.\..\$(SolutionRelativeIntDir)\generated\renderdoc.py;QRENDERDOC_PY_PATH=.\..\$(SolutionRelativeIntDir)\generated\qrenderdoc.py;%(PreprocessorDefinitions) diff --git a/scripts/dist.sh b/scripts/dist.sh index 307372ba7..8b3be9c55 100644 --- a/scripts/dist.sh +++ b/scripts/dist.sh @@ -27,11 +27,11 @@ mkdir -p dist/Release{32,64} # Copy files from release build in, without copying obj/ pushd x64/Release -find * -not -path 'obj*' -exec cp -r --parents '{}' ../../dist/Release64/ \; +find * -not -path 'obj*' -and -not -path 'pymodules*' -exec cp -r --parents '{}' ../../dist/Release64/ \; popd pushd Win32/Release -find * -not -path 'obj*' -exec cp -r --parents '{}' ../../dist/Release32/ \; +find * -not -path 'obj*' -and -not -path 'pymodules*' -exec cp -r --parents '{}' ../../dist/Release32/ \; popd # Copy in d3dcompiler from windows kit 8.1