diff options
| author | Alexandru Croitor <alexandru.croitor@qt.io> | 2022-10-28 12:41:13 +0200 |
|---|---|---|
| committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2022-11-09 16:36:39 +0100 |
| commit | cc0481a46f801473c3dbabe855534a7aa034443f (patch) | |
| tree | a212b7ec567b5c183457695920a87c70d378e24f /sources/pyside6/cmake | |
| parent | 0ba197308c7c6812723544b4f837102ec82fcec5 (diff) | |
CMake: Execute shiboken with appropriate PATH on Windows
Previously one had to add the Qt bin dir and libclang.dll dir to
PATH manually to ensure shiboken successfully runs when
building Qt for Python using CMake without setup.py.
This should not be necessary though, because the build system knows
where Qt is (usually via the --qtpaths option) and where libclang is
(via LLVM_INSTALL_DIR and friends).
Introduce a CMake function that generates a batch shell script wrapper
for a given tool. The wrapper will have PATH set to the Qt bin dir
and libclang dir.
Generate such a wrapper for shiboken and use it everywhere we call
shiboken to generate bindings.
The wrapper is only created on Windows.
All mentions of Shiboken6::shiboken in custom commands now need to be
wrapped in $<TARGET_FILE> because automatic target path conversion
only happens if the target appears as the first argument to a custom
command, and that is not the case anymore with the wrapper script
being at the front.
As a drive-by, the indentation of custom commands is now adjusted
for easier readability and to conform with the indentation used
in the Qt build system.
Pick-to: 6.4
Fixes: PYSIDE-1844
Change-Id: I287adeedf234d0272c2963e96ae2aa5c4c0f0c83
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/pyside6/cmake')
| -rw-r--r-- | sources/pyside6/cmake/Macros/PySideModules.cmake | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sources/pyside6/cmake/Macros/PySideModules.cmake b/sources/pyside6/cmake/Macros/PySideModules.cmake index 08b2127ed..cca66be8e 100644 --- a/sources/pyside6/cmake/Macros/PySideModules.cmake +++ b/sources/pyside6/cmake/Macros/PySideModules.cmake @@ -126,7 +126,12 @@ macro(create_pyside_module) install(FILES ${module_GLUE_SOURCES} DESTINATION share/PySide6${pyside6_SUFFIX}/typesystems/glue) endif() - set(shiboken_command Shiboken6::shiboken6 ${GENERATOR_EXTRA_FLAGS} + shiboken_get_tool_shell_wrapper(shiboken tool_wrapper) + + set(shiboken_command + ${tool_wrapper} + $<TARGET_FILE:Shiboken6::shiboken6> + ${GENERATOR_EXTRA_FLAGS} "--include-paths=${shiboken_include_dirs}" "--typesystem-paths=${pyside_binary_dir}${PATH_SEP}${pyside6_SOURCE_DIR}${PATH_SEP}${${module_TYPESYSTEM_PATH}}" --output-directory=${CMAKE_CURRENT_BINARY_DIR} |
