Turbo mode (build option)
Turbo mode is a build option that speeds up compile times significantly.
As the one-class-per-file convention is becoming more common in the project, compile times have become uncomfortably long. However, because the preferred code conventions also encourage keeping the global namespace clean, it is possible to merge multiple source files together and build them as one. This is much faster than compiling the files separately because the thousands of lines of C++ headers only need to be processed once.
The CMake option DENG_ENABLE_TURBO can be used to enable or disable the source file merging. The option is enabled by default starting from build 2033.
There are a few details and caveats to be aware of:
- When debugging with breakpoints, note that the original source files are not compiled into the binaries so you can't set breakpoints in them. Instead, breakpoints must be set in the generated src_*_turbo.cpp files (under the build directories). You may wish to disable Turbo while debugging with breakpoints, or set breakpoints on function names instead of source locations.
- The merging will join all includes separately from the code (see the generated src_*_turbo.cpp files). The merging is also configured on a per-directory basis, which means that static symbols should have unique names in the entire directory rather than just the single file.