mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-04 09:00:44 +00:00
Fix compatibility with python 3.14
This commit is contained in:
+1
-1
@@ -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
File diff suppressed because it is too large
Load Diff
@@ -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>
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user