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

ShibokenHelpers.cmake incorrectly handles multiple Clang build types

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: P4: Low P4: Low
    • None
    • 6.9.0, 6.9.1, 6.8.3
    • Build System
    • None
    • All

      The following code snippet is from sources/shiboken6/cmake/ShibokenHelpers.cmake, in setup_clang (around line 195).

      # CLANG_LIBRARY is read out from the cmake cache to deploy libclang
      get_target_property(CLANG_BUILD_TYPE libclang IMPORTED_CONFIGURATIONS)
      message(STATUS "CLANG build type: ${CLANG_BUILD_TYPE}")
      get_target_property(CLANG_LIBRARY_NAME libclang IMPORTED_LOCATION_${CLANG_BUILD_TYPE}) 

       The assumption here is that CLANG_BUILD_TYPE will be DEBUG or RELEASE.

      However, it is possible that there are both configs of clang installed (and this is actually the case when building the llvm package from vcpkg). The CLANG_BUILD_TYPE string in that case would be "DEBUG;RELEASE" (I checked this in practice).

      This causes a CMAKE error in the last line above, because of the ; character (and would fail otherwise too).

      This cmake file should handle that case well and fallback to one of the two build types if both are found.

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

            crmaurei Cristian Maureira-Fredes
            narcoticv Sander Vocke
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes