Name

mk_pch — Build pre-compiled header

Synopsis

MODULES="... compiler ..."

mk_pch SOURCE=source options...

Options

SOURCE=source

Indicates the header file to compile.

...

Common options are documented in the compiler module.

Description

Defines a target to build a pre-compiled C/C++ header file. Sets result to the generated target. By default, the correct language to use is guessed based on the file extension. Use the COMPILER option to choose explicitly (e.g. compile a .h file with the C++ compiler).

It is generally preferable to avoid explicitly building pre-compiled headers and instead pass the header to compile directly to the PCH option to mk_program et al. This helps ensure that the header is compiled with the same set of compiler flags and for the correct language.