Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-140024

qt6_generate_wayland_protocol_client_sources() generates broken code on Windows

XMLWordPrintable

    • Windows

      Steps to reproduce

      Load and build the Custom Shell example using a Boot to Qt (MinGW) kit.

       

      Outcomes

      C:/Qt/Examples/Qt-6.10.0/wayland/custom-shell/build/6.10.0-raspberrypi-armv8-Debug/client-plugin/qwayland-example-shell.cpp:4:10: error: #include expects "FILENAME" or <FILENAME>
          4 | #include ''
            |          ^~
      C:/Qt/Examples/Qt-6.10.0/wayland/custom-shell/build/6.10.0-raspberrypi-armv8-Debug/client-plugin/qwayland-example-shell.cpp:5:10: fatal error: ''/qwayland-example-shell.h: No such file or directory
          5 | #include <''/qwayland-example-shell.h>
            |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      compilation terminated.
      

       

      Analysis

      It appears that the Windows command interpreter does not like single quotes. The following patch fixes the first error above:

      ---
       src/client/Qt6WaylandClientMacros.cmake | 4 ++--
       1 file changed, 2 insertions(+), 2 deletions(-)
      
      diff --git a/src/client/Qt6WaylandClientMacros.cmake b/src/clientQt6WaylandClientMacros.cmake
      index c7ac085..5f37421 100644
      --- a/src/client/Qt6WaylandClientMacros.cmake
      +++ b/src/client/Qt6WaylandClientMacros.cmake
      @@ -80,8 +80,8 @@ function(qt6_generate_wayland_protocol_client_sources target)
                   COMMAND Qt6::qtwaylandscanner client-code
                       "${protocol_file}"
                       --build-macro=${build_macro}
      -                --header-path='${wayland_include_dir}'
      -                --add-include='${qtwaylandscanner_code_include}'
      +                --header-path="${wayland_include_dir}"
      +                --add-include="${qtwaylandscanner_code_include}"
                       > "${qtwaylandscanner_code_output}"
                   DEPENDS ${protocol_file} Qt6::qtwaylandscanner
               )
      

       

      Notes

      • Building on a Linux host works fine
      • I don't have Boot to Qt 6.5 LTS for testing, but the same code exists there so I'd expect Qt 6.5 to have the same issue.

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

            qtbuildsystem Qt Build System Team
            skoh-qt Sze Howe Koh
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes