Visible to Intel only — GUID: GUID-BDCEDA06-A3F2-4BA5-995A-9B281543766A
Visible to Intel only — GUID: GUID-BDCEDA06-A3F2-4BA5-995A-9B281543766A
pch
Tells the compiler to use appropriate precompiled header files.
Linux and macOS: |
-pch |
Windows: |
None |
None
OFF |
The compiler does not create or use precompiled headers unless you tell it to do so. |
This option tells the compiler to use appropriate precompiled header (PCH) files. If none are available, they are created as sourcefile.pchi. This option is supported for multiple source files.
The -pch option will use PCH files created from other sources if the headers files are the same. For example, if you compile source1.cpp using -pch, then source1.pchi is created. If you then compile source2.cpp using -pch, the compiler will use source1.pchi if it detects the same headers.
Depending on how you organize the header files listed in your sources, this option may increase compile times.
Visual Studio: None
Eclipse: Precompiled Headers > Automatic Processing for Precompiled Headers
Xcode: None
None
Example
Consider the following command line:
icpc -pch source1.cpp source2.cpp
It produces the following output when .pchi files exist:
"source1.cpp": using precompiled header file"source1.pchi" "source2.cpp": using precompiled header file "source2.pchi"
It produces the following output when .pchi files do not exist:
"source1.cpp": creating precompiled header file "source1.pchi" "source2.cpp": creating precompiled header file "source2.pchi"