Unity build
Principle
The principle is pretty simply, ub(unity build) create an extra .cpp fiile which will include all the other cpp file.
Then compile this file, so you only build one translation unit, avoid head file opened again and again in source file.
You might think you can do the job by precompile . Well, for a very stable project, you can, but most of the time,
lot of head file is unstable, they can not be precompiled.
How to do it
1. Create a new project configuration based on debug or release called UnityBuild, switch to this configuration.
2. Create a new filter called UnityBuild, create a new file named UnityBuild.cpp.
include all .cpp file to UnityBuild.cpp.
You can do it by hand, or create a small console program to help you do the tedious job.
3. Exclude all cpp file except UnityBuild.cpp from build, unset precompile.
Also you need to exclude UnityBuild.cpp frombuild in normal configuration.
It's done, so easy.