enable_language(C) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) add_library(empty empty.c) target_precompile_headers(empty PUBLIC ) add_library(foo foo.c) target_precompile_headers(foo PUBLIC ) set_target_properties(foo PROPERTIES PCH_INSTANTIATE_TEMPLATES OFF)