Closed niniemann closed 6 years ago
In sempr/src/CMakeLists.txt
there is a line like file(GLOB_RECURSE EXCLUDE_FROM_PCH [...] )
. You may extend this to add your own headers that should be excluded from the pch, which is useful during development of new modules. (Else there will be errors as you change files that are precompiled, and the compiler notices that...)
This PR adds some... CMake-Magic. :)
It's not real feature of SEMPR. It just helps me not losing my mind about horribly slow autocompletion: To speed things up, the compilation process of SEMPR saves a precompiled version of the headers and installs it into
include/sempr/sempr-core.pch
.To use it with
autocomplete-clang
, modify your.clang_complete
:Yes, the newline is necessary. It's a bug in clang.
The result? Instead of waiting like 5 seconds for every autocompletion, everything happens almost instantaneously. :)
Notice: This is mainly meant to be used in other projects, not when working on sempr-core. If you do, keep in mind that your autocompletion might be incomplete due to old pch-files. Also, the installation is a bit fake: The pch-file currently still references a cmake-generated
sempr-core.pch_all_includes.cpp
-file located in the sempr-core-build-directory. To make this independent I'll need to change the cmake to create the pch out of the installed files. But hey, it works for me. Oh, one more thing: The autocomple-clang-option "keep system header documentation" needs to be turned off. I'm missing some compilation-parameter there, I guess....