Skip to content

Commit 6a842ff

Browse files
committed
PCH: use cache dir in include path so GCC auto-picks up Processing.h.gch
1 parent 58177cc commit 6a842ff

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

mode/CppMode.jar

-8 Bytes
Binary file not shown.

src/java/CppBuild.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3197,7 +3197,9 @@ else if (!cmd.contains(defaultsCpp.getAbsolutePath()))
31973197
// main() is now emitted inside Sketch_run.cpp by writeSketch() -- don't link main.cpp
31983198
// Use precompiled header if available -- cuts sketch compile time significantly.
31993199
if (processingPch.exists() && !needsPch) {
3200-
cmd.add("-include-pch"); cmd.add(processingPch.getAbsolutePath());
3200+
// GCC automatically uses Processing.h.gch when the directory
3201+
// containing it appears before the src dir in the include path.
3202+
cmd.add("-I"); cmd.add(processingPch.getParentFile().getAbsolutePath());
32013203
}
32023204
cmd.add("-I" + runtimeDir.getAbsolutePath());
32033205
cmd.add("-o"); cmd.add(bin.getAbsolutePath());

0 commit comments

Comments
 (0)