Sun Studio 12 Update 1: C++ User's Guide

A.2.163 -xpchstop=file

Use the -xpchstop=file option to specify the last include file to be considered in creating the precompile-header file with the -xpch option. Using -xpchstop on the command line is equivalent to placing a hdrstop pragma after the first include-directive that references file in each of the source files that you specify with the cc command.

In the following example, the -xpchstop option specifies that the viable prefix for the precompiled header file ends with the include of projectheader.h. Therefore, privateheader.h is not a part of the viable prefix.


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

A.2.163.1 See also

-xpch, pragma hdrstop