Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-3105

Adapt shiboken generator for cross builds

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Fixed
    • Icon: P2: Important P2: Important
    • 6.10.0
    • 6.9.0
    • Shiboken
    • None
    • All
    • 194608527 (dev), 58c45157d (dev), 869b0d785 (dev), b72fd836f (dev), 7c9a9a426 (dev), 244b5dd5e (dev), a9479bf46 (dev), 7e1a38842 (dev), fa5e9bfd5 (dev), f9ea07b23 (dev), 3ad727140 (dev), 7acc42665 (6.9), de6f09b99 (dev), 8d0ca38ad (dev), 206cebdb7 (dev)

      Shiboken generator

      Currently, shiboken is not aware of cross builds. The code sources/shiboken6/ApiExtractor/clangparser/compilersupport.cpp detects the compiler from Clang, but does not otherwise know the target platform. Some parameters to the clang parser (system include paths/gl headers sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp:815 ) are set depending on the compiler, but may also need adaption to a target platform.

      The Android build passes the target as clang option --target=..., this can be used to obtain
      the platform triple and pointer size via libclang API.

      The config keys for the type system are hardcoded in ConditionalStreamReader::platformConditions() sources/shiboken6/ApiExtractor/conditionalstreamreader.cpp:164 .

      PySide

      Unrelated to shiboken, various ENABLE_MAC/ENABLE_WIN variables are set in CMake at sources/pyside6/cmake/PySideHelpers.cmake:143 that affect sources/pyside6/PySide6/global.h.in which defines the Q_OS_XX defines.

      For Android, tools/cross_compile_android/templates/toolchain_default.tmpl.cmake has "add_compile_definitions(ANDROID)". This should cause Q_OS_ANDROID to be set by
      qtbase/src/corelib/global/qsystemdetection.h .

      Q_OS_MAC is incorrectly set for iOS, causing missing symbols.

      Plans

      Shiboken generator should know the target platform via libclang API and can then set clang parameters accordingly.

      It could also set the Q_OS_XX defines based on that (when PySide extensions are enabled)? Or set defines for qtbase/src/corelib/global/qsystemdetection.h to work?

      References

      clangd parametrization in Qt Creator: plugins/cppeditor/compileroptionsbuilder.h

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            kleint Friedemann Kleint
            kleint Friedemann Kleint
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are 3 open Gerrit changes