Fix compatibility with python 3.14

This commit is contained in:
baldurk
2026-02-12 16:27:51 +00:00
parent 34b2cfdc40
commit d32b8a0371
5 changed files with 1452 additions and 14 deletions
+1 -1
View File
@@ -490,7 +490,7 @@ add_subdirectory(renderdoc)
# are handled in common
if(ENABLE_QRENDERDOC OR ENABLE_PYRENDERDOC)
# Make sure Python 3 is found
set(Python_ADDITIONAL_VERSIONS 3.15 3.14 3.13 3.12 3.11 3.10 3.9 3.8 3.7 3.6 3.5 3.4)
set(Python_ADDITIONAL_VERSIONS 3.18 3.17 3.16 3.15 3.14 3.13 3.12 3.11 3.10 3.9 3.8 3.7 3.6 3.5 3.4)
if(NOT ${CMAKE_VERSION} VERSION_LESS "3.12")
find_package(Python3 COMPONENTS Interpreter Development REQUIRED)
set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE})
+1406 -13
View File
File diff suppressed because it is too large Load Diff
+9
View File
@@ -47,6 +47,15 @@
<PythonOverride Condition="'$(VSPythonOverridePath)'=='' AND '$(Platform)'=='x64'">$(RENDERDOC_PYTHON_PREFIX64)</PythonOverride>
</PropertyGroup>
<PropertyGroup><PythonMajorMinorTest>318</PythonMajorMinorTest></PropertyGroup>
<PropertyGroup Condition="'$(CustomPythonUsed)'=='0' AND Exists('$(PythonOverride)\include\Python.h') AND Exists('$(PythonOverride)\python$(PythonMajorMinorTest).zip') AND (Exists('$(PythonOverride)\python$(PythonMajorMinorTest).lib') OR Exists('$(PythonOverride)\libs\python$(PythonMajorMinorTest).lib'))"><CustomPythonUsed>$(PythonMajorMinorTest)</CustomPythonUsed></PropertyGroup>
<PropertyGroup><PythonMajorMinorTest>317</PythonMajorMinorTest></PropertyGroup>
<PropertyGroup Condition="'$(CustomPythonUsed)'=='0' AND Exists('$(PythonOverride)\include\Python.h') AND Exists('$(PythonOverride)\python$(PythonMajorMinorTest).zip') AND (Exists('$(PythonOverride)\python$(PythonMajorMinorTest).lib') OR Exists('$(PythonOverride)\libs\python$(PythonMajorMinorTest).lib'))"><CustomPythonUsed>$(PythonMajorMinorTest)</CustomPythonUsed></PropertyGroup>
<PropertyGroup><PythonMajorMinorTest>316</PythonMajorMinorTest></PropertyGroup>
<PropertyGroup Condition="'$(CustomPythonUsed)'=='0' AND Exists('$(PythonOverride)\include\Python.h') AND Exists('$(PythonOverride)\python$(PythonMajorMinorTest).zip') AND (Exists('$(PythonOverride)\python$(PythonMajorMinorTest).lib') OR Exists('$(PythonOverride)\libs\python$(PythonMajorMinorTest).lib'))"><CustomPythonUsed>$(PythonMajorMinorTest)</CustomPythonUsed></PropertyGroup>
<PropertyGroup><PythonMajorMinorTest>315</PythonMajorMinorTest></PropertyGroup>
<PropertyGroup Condition="'$(CustomPythonUsed)'=='0' AND Exists('$(PythonOverride)\include\Python.h') AND Exists('$(PythonOverride)\python$(PythonMajorMinorTest).zip') AND (Exists('$(PythonOverride)\python$(PythonMajorMinorTest).lib') OR Exists('$(PythonOverride)\libs\python$(PythonMajorMinorTest).lib'))"><CustomPythonUsed>$(PythonMajorMinorTest)</CustomPythonUsed></PropertyGroup>
+18
View File
@@ -13,6 +13,24 @@
#include "3rdparty/pythoncapi_compat.h"
%}
%begin %{
#include <Python.h>
#if PY_VERSION_HEX >= 0x030d0000
inline PyObject *PyWeakref_GetObject_emu(PyObject *ref)
{
PyObject *ret = NULL;
if(PyWeakref_GetRef(ref, &ret) > 0)
Py_DECREF(ret);
return ret;
}
#undef PyWeakref_GET_OBJECT
#define PyWeakref_GET_OBJECT(x) PyWeakref_GetObject_emu(x)
#endif
%}
%begin %{
#undef slots
+18
View File
@@ -24,6 +24,24 @@
#include "3rdparty/pythoncapi_compat.h"
%}
%begin %{
#include <Python.h>
#if PY_VERSION_HEX >= 0x030d0000
inline PyObject *PyWeakref_GetObject_emu(PyObject *ref)
{
PyObject *ret = NULL;
if(PyWeakref_GetRef(ref, &ret) > 0)
Py_DECREF(ret);
return ret;
}
#undef PyWeakref_GET_OBJECT
#define PyWeakref_GET_OBJECT(x) PyWeakref_GetObject_emu(x)
#endif
%}
// include header for typed enums (hopefully using PEP435 enums)
%include <enums.swg>