aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/doc/tutorials/qmlintegration/main.py
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2022-10-31 18:03:22 +0100
committerAlexandru Croitor <alexandru.croitor@qt.io>2022-11-02 12:03:35 +0100
commit9cdf159ad131922772dd08ac38189993fc94ef7a (patch)
treeba04753ba125f9e60999ebf140a87fd8f3db8dfd /sources/pyside6/doc/tutorials/qmlintegration/main.py
parente065c10162f2c4cbaf1a4609d6426e250aeb4adc (diff)
CMake: Fix windows limited api build to work by default
Previously if one tried to build Qt For Python on Windows without explicitly specifying --limited-api=yes, the build would fail with LINK : fatal error LNK1104: cannot open file 'python3.lib' when linking libpyside. This happened due to a combination of reasons - limited api defaulted to ON when configuring shiboken due to option(FORCE_LIMITED_API "Enable the limited API." "yes") in ShibokenSetup.cmake - DPy_LIMITED_API=0x03060000 was recorded as a compile definition to be propagated to any target consuming libshiboken - limited api defaulted to OFF when configuring pyside because there is no option(FORCE_LIMITED_API) in the pyside project, and we also saved the previously computed value under a different name (SHIBOKEN_PYTHON_LIMITED_API) - libpyside was compiled with -DPy_LIMITED_API=0x03060000 but we never explicitly linked to python3.lib, only python310.lib. - the following pragma macro in pyconfig.h is transitively included when building every pyside object file: #elif defined(Py_LIMITED_API) #pragma comment(lib,"python3.lib") which instructed the MSVC linker to try and find python3.lib, but it can never be found because we specify python310.lib on the link line This is a fairly recent breakage due to the merging of 9adf4809460737576430c5d250288db628f18f0e. Before the mentioned change, FORCE_LIMITED_API would have the value ON, but the check was done against the string value "yes", which would always be false, and the build would link to the non-limited api libraries for both shiboken and pyside. So it would choose the wrong libraries for both projects, but the build would not fail, it would simply not be portable across python interpreters (probably). In the CI this issue never happened, because we explicitly pass --limited-api=yes to setup.py, which force overrides FORCE_LIMITED_API to ON when building both shiboken and pyside. To fix this, make sure we also check the value of SHIBOKEN_PYTHON_LIMITED_API when building pyside, which is the recorded option value exported as part of the shiboken build. Amends 97df448edbc035a2f531508a5cfe5739fb2de18d Amends 9adf4809460737576430c5d250288db628f18f0e Pick-to: 6.2 6.4 Task-number: PYSIDE-2091 Change-Id: I3771bc6b01cc0a65a920beebbd81f3b8d9aaf48a Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/pyside6/doc/tutorials/qmlintegration/main.py')
0 files changed, 0 insertions, 0 deletions