5

I would like to detect whether qmake is currently building using MingW (win32-gcc) or Visual Studio (win32-msvc200X).

At the moment I am using the following construct:

windows{
    contains(QMAKE_CC, gcc){
        # MingW
    }
    contains(QMAKE_CC, cl){
        # Visual Studio
    }
}

This does not seem particularly robust. Is there a better way?

Rasmus Faber
  • 48,631
  • 24
  • 141
  • 189

1 Answers1

8

Probably not anymore robust, but different:

windows {
    *-g++* {
        # MinGW
    }
    *-msvc* {
        # MSVC
    }
}
sjngm
  • 12,423
  • 14
  • 84
  • 114
Tuomas
  • 515
  • 5
  • 11