Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 82f289e92cd263af935dc2a9809e07fd1a83ffd4
      
https://github.com/WebKit/WebKit/commit/82f289e92cd263af935dc2a9809e07fd1a83ffd4
  Author: Geoffrey Garen <[email protected]>
  Date:   2026-05-11 (Mon, 11 May 2026)

  Changed paths:
    M Source/JavaScriptCore/CMakeLists.txt
    M Source/JavaScriptCore/shell/CMakeLists.txt
    M Source/ThirdParty/ANGLE/CMakeLists.txt
    M Source/WTF/wtf/PlatformIOS.cmake
    M Source/WTF/wtf/PlatformMac.cmake
    M Source/WebCore/CMakeLists.txt
    M Source/WebCore/PAL/pal/CMakeLists.txt
    M Source/WebGPU/WGSL/CMakeLists.txt
    M Source/WebGPU/WebGPU/CMakeLists.txt
    M Source/WebKit/CMakeLists.txt
    M Source/WebKit/PlatformGTK.cmake
    M Source/WebKit/PlatformIOS.cmake
    M Source/WebKit/PlatformMac.cmake
    M Source/WebKit/PlatformWPE.cmake
    M Source/WebKitLegacy/PlatformCocoa.cmake
    M Source/cmake/WebKitMacros.cmake
    M Tools/DumpRenderTree/CMakeLists.txt
    M Tools/TestWebKitAPI/CMakeLists.txt
    M Tools/TestWebKitAPI/PlatformMac.cmake
    M Tools/WebKitTestRunner/CMakeLists.txt
    M Tools/WebKitTestRunner/WebKitTestRunnerPrefix.h

  Log Message:
  -----------
  [CMake] Enable -fpch-codegen / -fpch-debuginfo
https://bugs.webkit.org/show_bug.cgi?id=314592
<rdar://problem/176830625>

Reviewed by David Kilzer and Mike Wyrzykowski.

Saves ~1m (~10%) build time. Shrinks build products by ~2GB (~24%).

These settings create a corresponding object file for a target's precompiled
header. -fpch-codegen emits inline functions into the object file, and
-fpch-debuginfo emits DWARF debug info. This saves individual .o files from
duplicating the same information.

(Sub-targets do not enable -fpch-codegen yet. I'm saving that for a follow-up
patch, which will need to resolve more inlining hygiene.)

* Source/JavaScriptCore/CMakeLists.txt: Specify our prefix header languages
to avoid codegen cost for languages we don't use, or use sparingly.

* Source/JavaScriptCore/shell/CMakeLists.txt: We use PREFIX_NO_CODEGEN for
tools because the prefix header does not export its symbols from the framework,
so we can't depend on them. We use REUSE_FROM to share a prefix header between
targets.

* Source/ThirdParty/ANGLE/CMakeLists.txt: Ditto on PREFIX_LANGUAGES and
PREFIX_NO_CODEGEN.

* Source/WTF/wtf/PlatformIOS.cmake:
* Source/WTF/wtf/PlatformMac.cmake:
* Source/WebCore/CMakeLists.txt:
* Source/WebCore/PAL/pal/CMakeLists.txt: Ditto on PREFIX_LANGUAGES.

* Source/WebGPU/WGSL/CMakeLists.txt: Ditto on PREFIX_LANGUAGES. Also, stop
compiling our source files twice in two targets. This is a build speedup on
its own, but also compiling twice breaks our prefix header.

* Source/WebGPU/WebGPU/CMakeLists.txt: Ditto on PREFIX_LANGUAGES. Remove -ObjC++
because it's already specified on the target, and it's an incompatibility with
the flags in our prefix header.

* Source/WebKit/CMakeLists.txt:
* Source/WebKit/PlatformGTK.cmake: Ditto on PREFIX_LANGUAGES and
PREFIX_NO_CODEGEN.

* Source/WebKit/PlatformIOS.cmake:
* Source/WebKit/PlatformMac.cmake: Reduced WebKit2 executables to only compiling
AuxiliaryProcessMain.cpp because the other files are already compiled as a part
of the WebKit target. This is a build speedup on its own, but also compiling
twice breaks our prefix header.

* Source/WebKit/PlatformWPE.cmake:
* Source/WebKitLegacy/PlatformCocoa.cmake: Ditto on PREFIX_LANGUAGES.

* Source/cmake/WebKitMacros.cmake: Added a helper for emitting an object file
alongside a prefix header. This is the heart of the speedup.

* Tools/DumpRenderTree/CMakeLists.txt:
* Tools/TestWebKitAPI/CMakeLists.txt:
* Tools/TestWebKitAPI/PlatformMac.cmake:
* Tools/WebKitTestRunner/CMakeLists.txt: Ditto on PREFIX_LANGUAGES.

* Tools/WebKitTestRunner/WebKitTestRunnerPrefix.h: Added WTFString.h because
it is heavily in test runner code. (Revealed by A/B testing.)

Canonical link: https://commits.webkit.org/313055@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to