diff options
Diffstat (limited to 'sources')
-rw-r--r-- | sources/pyside2/tests/pysidetest/CMakeLists.txt | 9 | ||||
-rw-r--r-- | sources/shiboken2/data/shiboken_helpers.cmake | 3 |
2 files changed, 10 insertions, 2 deletions
diff --git a/sources/pyside2/tests/pysidetest/CMakeLists.txt b/sources/pyside2/tests/pysidetest/CMakeLists.txt index 3c993cf4e..6c100475b 100644 --- a/sources/pyside2/tests/pysidetest/CMakeLists.txt +++ b/sources/pyside2/tests/pysidetest/CMakeLists.txt @@ -106,10 +106,17 @@ set_property(TARGET testbinding PROPERTY OUTPUT_NAME "testbinding${SHIBOKEN_PYTH if(WIN32) set_property(TARGET testbinding PROPERTY SUFFIX ".pyd") endif() + +if(PYTHON_LIMITED_API) + set(TESTBINDING_PYTHON_LIBS ${PYTHON_LIMITED_LIBRARIES}) +else() + set(TESTBINDING_PYTHON_LIBS ${PYTHON_LIBRARIES}) +endif() + target_link_libraries(testbinding pysidetest pyside2 - ${PYTHON_LIBRARIES} + ${TESTBINDING_PYTHON_LIBS} Shiboken2::libshiboken ${Qt5Core_LIBRARIES} ${Qt5Gui_LIBRARIES} diff --git a/sources/shiboken2/data/shiboken_helpers.cmake b/sources/shiboken2/data/shiboken_helpers.cmake index f4dd4d5dc..780509f58 100644 --- a/sources/shiboken2/data/shiboken_helpers.cmake +++ b/sources/shiboken2/data/shiboken_helpers.cmake @@ -13,8 +13,9 @@ macro(shiboken_check_if_limited_api) # On other platforms, this result is not used at all. execute_process( COMMAND ${PYTHON_EXECUTABLE} -c "if True: + import os for lib in '${PYTHON_LIBRARIES}'.split(';'): - if '/' in lib: + if '/' in lib and os.path.isfile(lib): prefix, py = lib.rsplit('/', 1) if py.startswith('python3'): print(prefix + '/python3.lib') |