PDA

View Full Version : qmake: detecting x86_64 architecture?



akos.maroy
31st July 2008, 15:11
I'm looking at the qmake documentation, and I wonder if it's possible to detect the architecture in detail of the system that qmake is being run on. I see the UNIX / WIN32 / MACX defined, but this is not detailed enough. I'd like to see separate linux x86 and x86_64, for example.

I saw some threads, like http://lists.trolltech.com/qt-interest/2007-03/thread00343-0.html , but none if these seem to be conclusive. Nor did I find anything conclusive on the undocumented qmake site.

Is there a way to safely tell the nature of the arch one is building on?

jpn
31st July 2008, 19:45
The link you gave shows an example:


*-g++-32 {
message("Any 32-bit GCC build")
}

You can do it the according way for 64-bit.

akos.maroy
2nd August 2008, 11:05
The link you gave shows an example:

You can do it the according way for 64-bit.

yes, but this actually doesn't work out of the box, as QMAKESPEC is set to linux-g++, not linux-g++-64 on a 64 bit box. neither is it set for linux-g++-32 on a 32 bit box, by default.

is there a way to detect the exact platform in a generic manner?

akos.maroy
2nd August 2008, 11:26
moreover, it seems that the mkspecs for qmake are not really named in a comprehensive way. for example you have linux-g++-32 and linux-g++-64 - but it is not obvious which architecture these mean? linux runs on a wide range of 32 and 64 bit operating architectures, ranging from intel (both 32 and 64 bit), sparc (both 32 and 64 bit), power, etc.

it might be that Qt itself is not ported to all of these, but for now I'm just looking at qmake as a cross-platform buiilding tool...