Uploaded image for project: 'Qbs ("Cubes")'
  1. Qbs ("Cubes")
  2. QBS-1504

Profiles for MinGW lack "qbs.architecture"

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • Not Evaluated
    • None
    • 1.13.0, 1.14.0
    • Command Line Frontend
    • None
    • Windows

    Description

      I tried to use qbs.architecture to decide between x86 or x86_64 binaries to link with. This works fine with the msvc kit, but not with the MinGW kit. Here is some test code to just output the content of the variables:

      import qbs
      
      Project {
          id: project
          name: {
              console.info("Start of output")
              console.info(qbs.toolchain)
              console.info(qbs.architecture)
              console.info("End of output")
              return "MyProject"
          }
      }
      
      

      When I compile this with "Qt 5.12.3 64bit (MSVC 2017)" it outputs:

      Start of output
      msvc
      x86_64
      End of output
      

      When I compile this with "Qt 5.11.2 MinGW 32bit" it outputs:

      Start of output
      mingw,gcc
      undefined
      End of output
      

      Notice that qbs.architecture is "undefined" now. I found the place where the kits are stored from Qt Creator:

      C:\Users\<user>\AppData\Roaming\QtProject\qtcreator\qbs\1.13.1\qbs.conf
      

      and this file shows that the MinGW kits just lack this value.

      I also looked at our build server, Qbs 1.14.0, and qbs config --list show the same thing with no qbs.architecture for our MinGW profiles.

      We can of course just add this architecture manually, but it would be nice to be able to write something in the Qbs file that just works on clean installs. I tried to read "cpp.toolchainInstallPath" in a Qbs file, as that path usually contains a directory with either "_32" or "_64", but Qbs couldn't read that value.

       

      Is this the proper way to check if we are compiling for x86 or x64, and if so, do you have a way of doing it today with MinGW profiles?

      Attachments

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

        Activity

          People

            kandeler Christian Kandeler
            staffan Staffan Hörnlund
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes