Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 405a323e0a80ad04a0609006e75f2e524858b296
https://github.com/WebKit/WebKit/commit/405a323e0a80ad04a0609006e75f2e524858b296
Author: Keith Miller <[email protected]>
Date: 2026-04-19 (Sun, 19 Apr 2026)
Changed paths:
M Source/JavaScriptCore/CMakeLists.txt
M Source/WebCore/CMakeLists.txt
M Source/WebCore/testing/js/WebCoreTestSupportPrefix.h
M Source/WebKit/CMakeLists.txt
M Source/WebKit/PlatformGTK.cmake
M Source/WebKit/PlatformMac.cmake
M Source/WebKit/PlatformPlayStation.cmake
M Source/WebKit/PlatformWPE.cmake
M Source/WebKitLegacy/CMakeLists.txt
M Source/WebKitLegacy/PlatformMac.cmake
R Source/WebKitLegacy/WebCoreSupport/WebViewGroup.cpp
A Source/WebKitLegacy/WebCoreSupport/WebViewGroup.mm
M Source/WebKitLegacy/WebKitLegacy.xcodeproj/project.pbxproj
M Source/cmake/OptionsMac.cmake
M Source/cmake/OptionsWin.cmake
M Source/cmake/WebKitCompilerFlags.cmake
M Source/cmake/WebKitMacros.cmake
M Tools/DumpRenderTree/CMakeLists.txt
M Tools/TestWebKitAPI/CMakeLists.txt
M Tools/TestWebKitAPI/Helpers/TestWebKitAPIPrefix.h
M Tools/WebKitTestRunner/CMakeLists.txt
M Tools/WebKitTestRunner/PlatformWin.cmake
M Tools/WebKitTestRunner/WebKitTestRunnerPrefix.h
Log Message:
-----------
Use pre-compiled headers consistently for all ports
https://bugs.webkit.org/show_bug.cgi?id=312210
rdar://174698623
Reviewed by Geoffrey Garen.
Contains changes originally authored by Zak Ridouh.
Use precompiled headers for all the various build targets consistently.
This is the first step towards removing "config.h" from all .cpp files.
* Source/cmake/WebKitCompilerFlags.cmake:
Remove CMAKE_DISABLE_PRECOMPILE_HEADERS ON, which was globally
disabling all target_precompile_headers() calls except on Windows.
Add -Wno-invalid-offsetof to list of GCC skipped warnings. GCC does
not preserve #pragma GCC diagnostic state across precompiled header
boundaries (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64117).
StdLibExtras.h uses a file-level pragma to suppress this warning but
with PCH enabled the pragma is lost when the PCH is loaded.
Mirror WEBKIT_PREPEND/APPEND_GLOBAL_*_FLAGS into CMAKE_OBJC_FLAGS
and CMAKE_OBJCXX_FLAGS so that .m/.mm sources on Apple ports get the
same WebKit-curated flag set (-fno-rtti, -fno-exceptions, warnings,
etc.) as their .c/.cpp counterparts.
* Source/cmake/OptionsMac.cmake:
Enable OBJC and OBJCXX languages so CMake generates separate PCH
files per language. Without this, CMake falls back to compiling .mm
as CXX, producing a CXX-only PCH that is rejected when force-
included into .mm sources: "Objective-C was disabled in precompiled
file ... but is currently enabled".
* Source/cmake/WebKitMacros.cmake:
Add ADD_WEBKIT_PREFIX_HEADERS macro that wraps
target_precompile_headers() with two workarounds:
1. OBJCXX is excluded from the PCH because WebKit targets mix ARC
and non-ARC .mm sources in the same target. CMake generates one
PCH per language per target, so ARC sources would get a non-ARC
PCH (or vice versa). OBJCXX sources still get the prefix header
via a plain -include flag.
2. Targets with Swift sources fall back to -include for ALL
languages. CMake's Swift linker rule includes the .pch in the
link inputs, producing "unexpected input file: ...pch".
Filter .gch/.pch files from $<TARGET_OBJECTS:...> for OBJECT library
targets to prevent precompiled header files from being passed to the
linker (lld rejects them; Prospero Clang misinterprets them).
* Source/WebKitLegacy/WebCoreSupport/WebViewGroup.cpp:
Renamed to WebViewGroup.mm. This file includes WebView.h which
includes Foundation.h unconditionally, requiring ObjC++ mode. The
Xcode project already marked it as explicitFileType =
sourcecode.cpp.objcpp, which was weird.
* Source/WebCore/testing/js/WebCoreTestSupportPrefix.h:
Remove unused Windows/ColorSync/CFNetwork configuration. Guard
CoreServices include on OS(DARWIN). Remove incorrect
WEBCORE_TESTSUPPORT_EXPORT definition that resolved to dllimport
when building WebCoreTestSupport, preventing
PlatformExportMacros.h from setting the correct export macro.
* Tools/TestWebKitAPI/Helpers/TestWebKitAPIPrefix.h:
Add cmakeconfig.h include before Platform.h so that CMake feature
defines override PlatformEnable.h defaults.
* Tools/WebKitTestRunner/WebKitTestRunnerPrefix.h:
Move Platform.h include before WebKit2_C.h. The latter transitively
includes WKView.h which uses ENABLE()/USE() macros that require
Platform.h.
Canonical link: https://commits.webkit.org/311551@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications