32 lines
1.4 KiB
Diff
32 lines
1.4 KiB
Diff
pyside2 cmake code does not handle crossbuild while generating pyi files.
|
|
(stub files for type checker).
|
|
From now, disable their generation.
|
|
|
|
--- sources/pyside2/cmake/Macros/PySideModules.cmake.ORIG
|
|
+++ sources/pyside2/cmake/Macros/PySideModules.cmake
|
|
@@ -201,18 +201,24 @@
|
|
endif()
|
|
|
|
# Add target to generate pyi file, which depends on the module target.
|
|
+ if(NOT CMAKE_CROSSCOMPILING)
|
|
add_custom_target("${module_NAME}_pyi" ALL
|
|
COMMAND ${CMAKE_COMMAND} -E env ${ld_prefix}
|
|
"${SHIBOKEN_PYTHON_INTERPRETER}"
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/../support/generate_pyi.py" ${generate_pyi_options})
|
|
add_dependencies("${module_NAME}_pyi" ${module_NAME})
|
|
+ else()
|
|
+ message(STATUS "crossbuild: disable generation of ${module_NAME}_pyi")
|
|
+ endif()
|
|
|
|
# install
|
|
install(TARGETS ${module_NAME} LIBRARY DESTINATION "${PYTHON_SITE_PACKAGES}/PySide2")
|
|
|
|
+ if(NOT CMAKE_CROSSCOMPILING)
|
|
file(GLOB hinting_stub_files RELATIVE "${CMAKE_CURRENT_BINARY_DIR}/PySide2" "${CMAKE_CURRENT_BINARY_DIR}/PySide2/*.pyi")
|
|
install(FILES ${hinting_stub_files}
|
|
DESTINATION "${PYTHON_SITE_PACKAGES}/PySide2")
|
|
+ endif()
|
|
|
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PySide2/${module_NAME}/pyside2_${lower_module_name}_python.h
|
|
DESTINATION include/PySide2${pyside2_SUFFIX}/${module_NAME}/)
|