cotire icon indicating copy to clipboard operation
cotire copied to clipboard

New pre-compiled headers support in CMake 3.16

Open Mr-Rayman opened this issue 5 years ago • 2 comments

CMake 3.16 provides new support for pre-compiled headers:

  • The “target_precompile_headers()” command was added to specify a list of headers to precompile for faster compilation times.

  • The “UNITY_BUILD” target property was added to tell generators to batch include source files for faster compilation times.

https://blog.kitware.com/cmake-3-16-0-rc1-is-ready-for-testing/

I assume these new functions replace cotire in the future ..

Best, Stefan

Mr-Rayman avatar Oct 11 '19 10:10 Mr-Rayman

Do you have to manually specify the headers you want precompiled in target_precompile_headers()? Because cotire seemed to determine the relevant headers by itself somehow. Would there be a way to use that functionality of cotire to set the headers to precompile automatically?

fschoenm avatar Jan 03 '20 09:01 fschoenm

Do you have to manually specify the headers you want precompiled in target_precompile_headers()? Because cotire seemed to determine the relevant headers by itself somehow. Would there be a way to use that functionality of cotire to set the headers to precompile automatically?

As far as I understand you have to spedify the headers manually. This is the way I do it now with new pre-compiled headers feature in CMake in it works well.

Mr-Rayman avatar Jan 19 '20 13:01 Mr-Rayman