Skip to content
digited edited this page Sep 6, 2013 · 4 revisions

###Development goals

  • Free open source, BSD or similar really free license.
  • No external dependencies except Qt. All required libraries should be packed in projects. LGPL libraries should be avoided, GPL libraries can't be used in any form being viral.
  • No STL, no Boost. Qt has lightweight code for almost any task where those would've been used.

###Compilation

By default, Qt projects are being compiled in a single thread. To use multiple cpu cores effectively and seriously speed up compilation from QtCreator, go to "Projects" -> "Build settings" -> "Build steps" -> "Make:" and press "v" to show field for make options, add "-jN" there where N is number of cores in your cpu + 1. For Core Duo/amd x2 optimal is "-j3", for quad core - "-j5". +1 is because hdd/ram operations use considerable amount of time while a cpu core isn't loaded and waits for finishing disk-heavy operaton. OS load balancer will use a free cpu core on that extra compilation thread, effectively loading all cpu cores all the time.

Other option could be to use MAKEFLAGS variable in .pro files, but because developers use different cpu's and .pro are under version control, this would pollute Git with frequent changes of that -jN in .pro - so that doesn't work for more than one developer on more than one machine.

It may be possible to use "jom" builder in the future, but that future hasn't come atm

###G++ flags

By default, GCC G++ compiles C++ code as C++03 standard, without C++11 features such as lambdas and auto. To enable support of C++11 features, add "-std=c++11" to CXX_FLAGS in .pro

On different OS even the same version of g++ seems to use different warning levels by default. In C++, every warning is a potential bug at least, and a potential crash at worst. Standard approach is to avoid all warnings in code if possible, thus it is recommended to add "-Wall" to CXX_FLAGS in all .pro

Clone this wiki locally