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

Adapt shiboken generator for cross builds

    XMLWordPrintable

Details

    • Task
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.9.0
    • Shiboken
    • None
    • All
    • 14699b3ba (dev), 5587fe5f0 (dev), 8115effa6 (6.9), 74e657a11 (6.9)

    Description

      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.

      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?

      Attachments

        Issue Links

          For Gerrit Dashboard: PYSIDE-3105
          # Subject Branch Project Status CR V

          Activity

            People

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

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes