可使用 -xpchstop=file 选项指定在使用 -xpch 选项创建预编译头文件时要考虑的最后一个 include 文件。在命令行上使用 -xpchstop 与将 hdrstop pragma 置于第一个(引用使用 cc 命令指定的每个源文件中的 file 的)包含指令之后等效。
在以下示例中,-xpchstop 选项指定了预编译头文件的活前缀以包含 projectheader.h 结束。因此,privateheader.h 不是活前缀的一部分。
example% cat a.cc
#include <stdio.h>
#include <strings.h>
#include "projectheader.h"
#include "privateheader.h"
.
.
.
example% CC -xpch=collect:foo.Cpch a.cc -xpchstop=projectheader.h -c
|
-xpch 和 pragma hdrstop。