12

I am trying to build Qt because it is required for Visual Studio 2010. The build script (configure.exe) is quite straightforward but by default it takes ages to compile. After waiting for an hour on a fast notebook with an SSD, I've given up (using no flags, just configure.exe).

What are the recommended flags for a basic, lightweight Qt application? I mean for someone learning Qt, who doesn't need WebKit and so on.

I've collected the most useful links I found:

The reference page for Qt configure: http://doc.qt.io/qt-4.8/configure-options.html

Ben's advice from this question: Building Qt 4.5 with Visual C++ 2010

-no-webkit -no-phonon -no-phonon-backend -no-script -no-scripttools -no-multimedia -no-qt3support -fast

Rubenvb's advice from this question: How to compile Qt as static

  1. Disable debug: -release
  2. Disable modules you don't need, especially QtWebKit: -no-webkit -no-script -no-scripttools -no-qt3support -nomake demos -nomake tools -nomake examples
  3. Disable LTCG support, which has the nasty side effect of generating huge static libraries: no-ltcg
Community
  • 1
  • 1
hyperknot
  • 12,019
  • 22
  • 87
  • 143

1 Answers1

5

That should be ok. Everything beyond webkit is just micro-optimization, if it comes to build times (webkit is huge). I wouldn't set -nomake tools when you want to explore Qt, as you might want to use those tools.

Frank Osterfeld
  • 23,778
  • 3
  • 52
  • 66
  • Thank you! After a lot of experimenting, I've settled down on: `configure.exe -release -no-webkit -no-phonon -no-phonon-backend -no-script -no-scripttools -no-qt3support -no-multimedia -no-ltcg` The only one I'm not so sure about is -no-ltcg. Does it have any side effect? – hyperknot Apr 08 '11 at 12:36
  • As far as I understand `no-ltcg` = faster builds, less optimized code. Might want to turn it on for releases? – toster-cx Jan 07 '16 at 19:36