[Interest] Slow compiling on Mac

Till Oliver Knoll till.oliver.knoll at gmail.com
Thu Aug 30 12:37:10 CEST 2012

Am 30.08.2012 um 11:47 schrieb Bo Elmgreen <bo.elmgreen at gmail.com>:

> ...(gcc in QtCreator and clang in Xcode)

Here you go, you answered your own question! :)

You were not comparing Qt Creator vs Xcode, but rather gcc vs clang!

> ... are there tricks we can use to speed up the compiling?

Usually the environment variable QMAKESPEC tells 'qmake' how to generate the Makefiles (for what compiler).

I think the equivalent settings you'll find in the "Project" tab (left toolbar) in Qt Creator (they get saved in a per user YourProject.pro.user file), so you don't have to mess around with environment variables yourself.

And as to have a really fair comparison make sure that you are using the same compiler switches (you can set/override the QMAKESPEC default ones in your *.pro file, if desired - refer to the qmake docu).

At least make sure you are comparing the same debug/release configuration - just saying ;)


P.S. Chances are that Qt Creator might not find the necessary Clang executables in the PATH after you have changed the QMAKESPEC (rerun qmake btw!). This is because since Xcode 4 appeared in the Mac App Store it keeps everything in its own package bundle, instead of installing compilers into the "usual" places such as /usr/bin etc.

So you could either point your PATH env variable to the appropriate places in /Applications/Xcode/... or (much easier) launch Xcode and figure out where to download the "Command Line Tools" (or similar) which downloads a nice Installer package.

(Note that Apple is circumventing their own Mac App Store rules here but psssst! We won't complain here, will we? ;))

That means you end up with two copies  of clang on your system, but such is life...

More information about the Interest mailing list