4

I have a quite large project that would enjoy some speedup in compilation. I'm on OSX 10.8 (clang/llvm), but I will port this to gcc as well. I am trying to tinker with .pch files but I noted in the llvm documentation that pch files are only parsed and used if -include is used at the command line. It doesn't automatically do it from the #include directive in the file.

I was wondering how to add automatically -include for the proper include files. I am using CMake to create the makefiles.

Stefano Borini
  • 138,652
  • 96
  • 297
  • 431

1 Answers1

3

Likely it's enough to add required flags to CMAKE_CXX_FLAGS. Something like

SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -include <you-precompiled-header>")
user3159253
  • 16,836
  • 3
  • 30
  • 56