Wagmare
Wagmare

Reputation: 1406

How to check the compiler version in Qt .pro file?

I want to build a Qt project using either GCC or an ARM compiler. In either environment I have to link different libraries.

How I can check if the current compiler is Linux's g++ and CROSS_COMPILE is 'arm-cortexa9neont-linux-gnueabi-'?

Upvotes: 0

Views: 1776

Answers (2)

xarxer
xarxer

Reputation: 346

You can use the Platform Scope built in to QMake to set up the build differently depending on platform.

It's based on the mkspec's shipped with Qt and can be found in

[Where Qt's installed]/mkspecs

So in your case I guess it'll look something like this:

linux-arm-gnueabi {
    //ARM stuff here
}

Please note that I have not tested this. I've only read what's in the documentation I have linked to.

Upvotes: 2

trivelt
trivelt

Reputation: 1965

If you want to know only type of processor, you can use Q_PROCESSOR_ARM macro.

Upvotes: 2

Related Questions