0

Background

I have cross-compiled Qt for ARM target using the arm-linux-gnueabihf-gcc toolchain.

running qmake -query gives (among other values) QMAKE_XSPEC:arm-linux-gnueabihf-g++.

When running qbs-setup-qt <path to the qmake> armqt I get empty ("") value for Qt.core's tragetPlatform property for the armqt profile. I would expect to get "linux".

This causes a failure when loading the Qt.core module, which has a condition that forces qbs.targetPlatform === targetPlatform. Here qbs.targetPlatform equals "linux" while targetPlatform is empty.

The target platform is determined in qtprofilesetup.cpp at the function qbsTargetPlatformFromQtMkspec. It looks for QMAKE_XSPEC values starting with "linux-"

My question

Is there a way to avoid this false detection? I can patch the code to allow the 'linux' to appear after the first'-' or something like that, but I'm not sure it has other effects.

Thanks.

john smith
  • 13
  • 4
  • Where does this Qt installation come from? A Linux distribution? – Christian Kandeler Oct 25 '18 at 12:31
  • Oh, you nailed it, @Christian. I had Qt compiled from source using my own mkspec directory, which I had named `arm-linux-gnueabihf-g++`. This was in contrast to the convention of starting the directory name with the platform name. That was harmless, until Qbs got into the picture. I renamed my mkspec directory to begin with `linux-`, and now Qbs detects my platform correctly. Thanks. – john smith Oct 28 '18 at 07:22
  • That's good to hear. Sometimes Linux distributions don't follow the convention, e.g. Fedora names their mingw mkspecs "mingw-something" instead of "win32-g++-something", which also used to cause problems with qbs. So I was worried we'd have another instance of that here. – Christian Kandeler Oct 29 '18 at 08:40

0 Answers0