mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-04 09:00:44 +00:00
Check shiboken2's python version matches python version we're linking to
* We also reverse Python_ADDITIONAL_VERSIONS so it finds the newest one. It doesn't seem like there's a way in general to make these match, so we hope that searching from newest to oldest will find the same in both - or at least it makes it easier for the user to fix by installing the newest in both.
This commit is contained in:
+1
-1
@@ -390,7 +390,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.4 3.5 3.6 3.7 3.8)
|
||||
set(Python_ADDITIONAL_VERSIONS 3.8 3.7 3.6 3.5 3.4)
|
||||
find_package(PythonInterp 3 REQUIRED)
|
||||
find_package(PythonLibs 3 REQUIRED)
|
||||
# we also need python3-config for swig
|
||||
|
||||
@@ -215,9 +215,17 @@ if(NOT BUILD_VERSION_DIST_CONTACT STREQUAL "")
|
||||
"DEFINES+=DISTRIBUTION_CONTACT='\\\\\"${BUILD_VERSION_DIST_CONTACT}\\\\\"'\n")
|
||||
endif()
|
||||
|
||||
if(PySide2_FOUND AND Shiboken2_FOUND)
|
||||
option(QRENDERDOC_ENABLE_PYSIDE2 "Enable PySide2 if found" ON)
|
||||
|
||||
if(NOT QRENDERDOC_ENABLE_PYSIDE2)
|
||||
message(STATUS "PySide2 integration disabled")
|
||||
elseif(PySide2_FOUND AND Shiboken2_FOUND)
|
||||
message(STATUS "Building with PySide2 ${PySide2_VERSION} from ${PySide2_DIR}")
|
||||
|
||||
if(NOT PYTHONLIBS_VERSION_STRING MATCHES "${SHIBOKEN_PYTHON_VERSION_MAJOR}.${SHIBOKEN_PYTHON_VERSION_MINOR}")
|
||||
message(FATAL_ERROR "Shiboken2 that we found was linked against python ${SHIBOKEN_PYTHON_VERSION_MAJOR}.${SHIBOKEN_PYTHON_VERSION_MINOR} but the python library we're linking against is ${PYTHONLIBS_VERSION_STRING}. Ensure these versions are identical or disable PySide2 compilation with QRENDERDOC_ENABLE_PYSIDE2.")
|
||||
endif()
|
||||
|
||||
get_target_property(SHIBOKEN2_INCLUDE_DIRS Shiboken2::libshiboken INTERFACE_INCLUDE_DIRECTORIES)
|
||||
get_target_property(PYSIDE2_INCLUDE_DIRS PySide2::pyside2 INTERFACE_INCLUDE_DIRECTORIES)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user