PDA

View Full Version : How to determine the compiler-version (GCC) ?



Comer352l
2nd January 2009, 17:06
Hi,

does anyone know how to determine the compiler-version (GCC) ?
With GCC-versions >=4.2, the "-fgcse" optimization (enabled at optimization level 2) causes an enormous binary size increase (about 1000% with 4.3.x !!!), but I don't want to disable it generally (with QMAKE_CXXFLAGS)...

wysota
2nd January 2009, 19:55
gcc -v returns the version string. You can have a script that uses tools such as sed, cut and grep that will process its output and return only the version number or 0/1 depending on the version found. You can then call such a script from qmake project and evaluate its output.