Hacker News new | ask | show | jobs
by Athas 2379 days ago
Can you compile a header to an object file so that its definitions don't have to be recompiled every time the including file is recompiled?
1 comments

Eh... Yes?

GCC [0], Clang [1] and others [2] have supported for compiled headers. Cmake also has support for precompiled headers [3].

I would say both the tool and architecture to do that is well supported.

[0] https://gcc.gnu.org/onlinedocs/gcc/Precompiled-Headers.html

[1] https://clang.llvm.org/docs/PCHInternals.html

[2] https://www.qnx.com/developers/docs/6.3.2/neutrino/utilities... (-pch flag)

[3] https://cmake.org/cmake/help/latest/command/target_precompil...