Alex Rivera | Logout

Compiler scope values in qmake

Asked 2013-01-25T13:53:09.107
8

qmake provides several built-in platform scopes, allowing a project file to perform different operations depending on the current platform:

win32 {
    ...
}
unix {
    ...
}

All platform specifications in the mkspecs directory can also be used to test various platform/compiler combination, e.g.

linux-g++ {
    ...
}
win32-g++ {
    ...
}
win32-msvc2003 {
    ...
}

However, I can't seem to find a way to test only the compiler (without the os)

#This does not work
g++ {
    ...
}
msvc {
    ...
}

Is there a way to do this without having to list all combinations (linux-g++ | win32-g++ | cygwin-g++ | ... {})? If this is not possible, is there a good reason?

Edit
Report

1 Answer

9

You can do it like this:

*-g++ {
    ...
}
win32-msvc* {
    ...
}
answered 2013-01-25T14:13:15.340

Your Answer