[Qt-interest] Making VS links faster
Tony Rietwyk
tony.rietwyk at rightsoft.com.au
Mon Aug 24 07:59:22 CEST 2009
Hi Everybody,
I have a Qt 4.5.2 project with many forms and source files. During the build 1,000 obj files are created, of which 400 are from moc files. On mac the project builds and links in about 5 mins. On win VS 2005 it takes over 15 mins. Most development is done on win. During the day, the builds do get faster, as more files are cached by the system, but even with only one source file to compile, the link still takes two minutes. On mac, the same situation builds in 20-30 secs.
It would be nice if the moc output from the headers could be just compiled with the associated cpp file, instead of producing a separate obj file. I know that it is necessary to include the moc in the cpp file, if the cpp file contains object decalarations with Q_OBJECT. Is there a qmake switch that forces .h file moc objects to be included in the cpp, as well, instead of being separately compiled? Alternatively, if I always include the moc in the cpp, will qmake suppress compiling the moc output separately?
I realise that 4.5.0 had an issue with a linker switch for release that caused the link time to be twice as long. All of our projects have been cleaned and rebuilt many times since then.
Interestingly, running qmake on this project is at least ten times faster on mac as well, compared to win. The mac is an iMac with OSX 10.5.8 and XCode, the win is a Dell Precision laptop with 7200 rpm disk drive and XPSP3. CPU speeds are pretty similar.
Regards,
Tony.
More information about the Qt-interest-old
mailing list