I've found a lot of examples on how to use precompiled headers for MSVC, but I can't seem to find any examples using clang. From this SO post I can see the clang commands but I'm wondering how they translate into cmake:
Decrease clang compile time with precompiled headers
to create pre-compiled header include all the headers you don't change > > into Query.h and use:
clang -cc1 Query.h -emit-pch -o Query.h.pch to use the pre-compiled header type:
clang -cc1 -include-pch Query.h.pch Query.cpp -shared -o libquery.so; Query.cpp needs to include Query.h
Edit: Using clang 6 and cmake 3.11.2