Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 82220a2f11379d6f8a9b39ffecf311a9472721f2
      
https://github.com/WebKit/WebKit/commit/82220a2f11379d6f8a9b39ffecf311a9472721f2
  Author: Elliott Williams <[email protected]>
  Date:   2026-08-26 (Wed, 26 Aug 2026)

  Changed paths:
    M CMakeLists.txt
    M Source/CMakeLists.txt
    M Source/JavaScriptCore/PlatformCocoa.cmake
    M Source/WebCore/PlatformCocoa.cmake
    M Source/WebGPU/WebGPU/CMakeLists.txt
    M Source/WebKit/PlatformCocoa.cmake
    M Source/WebKit/PlatformGTK.cmake
    M Source/WebKit/PlatformWPE.cmake
    M Source/WebKitLegacy/PlatformCocoa.cmake
    M Source/cmake/BubblewrapSandboxChecks.cmake
    M Source/cmake/FindATK.cmake
    M Source/cmake/FindATKBridge.cmake
    M Source/cmake/FindATSPI.cmake
    M Source/cmake/FindAVIF.cmake
    M Source/cmake/FindBreakpad.cmake
    M Source/cmake/FindBrotli.cmake
    M Source/cmake/FindCairo.cmake
    M Source/cmake/FindEnchant.cmake
    M Source/cmake/FindEpoxy.cmake
    M Source/cmake/FindGBM.cmake
    M Source/cmake/FindGLib.cmake
    M Source/cmake/FindGTK.cmake
    M Source/cmake/FindHarfBuzz.cmake
    M Source/cmake/FindJPEGXL.cmake
    M Source/cmake/FindJournald.cmake
    M Source/cmake/FindLCMS2.cmake
    M Source/cmake/FindLibGcrypt.cmake
    M Source/cmake/FindLibInput.cmake
    M Source/cmake/FindLibPSL.cmake
    M Source/cmake/FindLibseccomp.cmake
    M Source/cmake/FindManette.cmake
    M Source/cmake/FindOpenGL.cmake
    M Source/cmake/FindOpenGLES2.cmake
    M Source/cmake/FindSecret.cmake
    M Source/cmake/FindSoup3.cmake
    M Source/cmake/FindSysProfCapture.cmake
    M Source/cmake/FindTasn1.cmake
    M Source/cmake/FindUdev.cmake
    M Source/cmake/FindWOFF2.cmake
    M Source/cmake/FindWPE.cmake
    M Source/cmake/FindWPEBackendFDO.cmake
    M Source/cmake/FindWebP.cmake
    M Source/cmake/FindXkbCommon.cmake
    M Source/cmake/OptionsCocoa.cmake
    M Source/cmake/OptionsCommon.cmake
    M Source/cmake/OptionsGTK.cmake
    M Source/cmake/OptionsPlayStation.cmake
    M Source/cmake/OptionsWPE.cmake
    M Source/cmake/WebKitCommon.cmake
    M Source/cmake/WebKitCompilerFlags.cmake
    M Source/cmake/WebKitMacros.cmake
    M Tools/MiniBrowser/playstation/CMakeLists.txt
    M Tools/Scripts/swift/swiftc-wrapper.py
    M Tools/TestWebKitAPI/CMakeLists.txt
    M Tools/TestWebKitAPI/PlatformCocoa.cmake
    M Tools/WebKitTestRunner/PlatformCocoa.cmake
    M Tools/gtk/manifest.txt.in
    M Tools/wpe/manifest.txt.in

  Log Message:
  -----------
  [CMake] Stop rewriting arguments in swiftc-wrapper
https://bugs.webkit.org/show_bug.cgi?id=322312

Reviewed by Adrian Taylor and Richard Robinson.

Remove all [1] the custom argument rewriting done in `swiftc-wrapper.py`
and change the build config to coherently pass them. Now, the compiler
and linker arguments as described by CMake apply directly to swift.

This also makes it easy to drop in a replacement compiler instead of
using swiftc-wrapper; previously doing so would fail the build.

For the most part, this entails using `LINKER:` to instruct CMake to
pass arguments through swift's frontend to ld.

One bit of complexity is a new way of handling preprocessor definitions.
Swift supports valueless definitions only (i.e. -DFOO, not -DFOO=VALUE):
Add `webkit_add_compile_definitions` and
`webkit_target_compile_definitions` which wrap their respective CMake
functions, and process the the declarations into ones that can and
cannot be expressed to Swift. The ones that cannot be expressed are
hidden via genexprs, but they are still passed *through* Swift to the
clang importer.

Similarly, add a `webkit_pkg_check_modules` wrapper for 3rd-party
libraries. For vendored code that we include without using FindPackage,
add a `webkit_scope_target_interface_definitions` function that rewrites
the compiler definitions post-hoc, to avoid editing upstream code.

[1]: AFAICT, we still need to rewrite Windows linker arguments, because
     CMake itself incorrectly passes those through to swift. So, retain that
     one case.

* CMakeLists.txt:
* Source/JavaScriptCore/PlatformCocoa.cmake:
* Source/WebCore/PlatformCocoa.cmake:
* Source/WebGPU/WebGPU/CMakeLists.txt:
* Source/WebKit/PlatformCocoa.cmake:
* Source/WebKit/PlatformGTK.cmake:
* Source/WebKit/PlatformWPE.cmake:
* Source/WebKitLegacy/PlatformCocoa.cmake:

The Find* modules for GTK builds propagate some pkg-config CFLAGS that
are irrelevant to Swift. Add some shared logic to turn them into
genexprs that filter them out.

* Source/cmake/BubblewrapSandboxChecks.cmake:
* Source/cmake/FindCairo.cmake:
* Source/cmake/FindEpoxy.cmake:
* Source/cmake/FindGLib.cmake:
* Source/cmake/FindHarfBuzz.cmake:
* Source/cmake/FindOpenGL.cmake:
* Source/cmake/FindSoup3.cmake:
* Source/cmake/FindWPE.cmake:
* Source/cmake/OptionsCocoa.cmake:
* Source/cmake/OptionsCommon.cmake:
* Source/cmake/OptionsGTK.cmake:
* Source/cmake/OptionsPlayStation.cmake:
* Source/cmake/OptionsWPE.cmake:
* Source/cmake/WebKitCompilerFlags.cmake:
* Source/cmake/WebKitMacros.cmake:
* Tools/MiniBrowser/playstation/CMakeLists.txt:
* Tools/Scripts/swift/swiftc-wrapper.py:
(main):
(expand_response_file): Deleted.
(process_args): Deleted.
(filter_benign_warnings):
* Tools/TestWebKitAPI/CMakeLists.txt:
* Tools/TestWebKitAPI/PlatformCocoa.cmake:
* Tools/WebKitTestRunner/PlatformCocoa.cmake:
* Tools/gtk/manifest.txt.in:
* Tools/wpe/manifest.txt.in:
* Source/CMakeLists.txt:
* Source/cmake/FindATK.cmake:
* Source/cmake/FindATKBridge.cmake:
* Source/cmake/FindAVIF.cmake:
* Source/cmake/FindBreakpad.cmake:
* Source/cmake/FindBrotli.cmake:
* Source/cmake/FindEnchant.cmake:
* Source/cmake/FindGBM.cmake:
* Source/cmake/FindJPEGXL.cmake:
* Source/cmake/FindJournald.cmake:
* Source/cmake/FindLCMS2.cmake:
* Source/cmake/FindLibGcrypt.cmake:
* Source/cmake/FindLibInput.cmake:
* Source/cmake/FindLibPSL.cmake:
* Source/cmake/FindLibseccomp.cmake:
* Source/cmake/FindManette.cmake:
* Source/cmake/FindOpenGLES2.cmake:
* Source/cmake/FindSysProfCapture.cmake:
* Source/cmake/FindTasn1.cmake:
* Source/cmake/FindUdev.cmake:
* Source/cmake/FindWOFF2.cmake:
* Source/cmake/FindWPEBackendFDO.cmake:
* Source/cmake/FindWebP.cmake:
* Source/cmake/WebKitCommon.cmake:
* Source/cmake/FindATSPI.cmake:
* Source/cmake/FindGTK.cmake:
* Source/cmake/FindSecret.cmake:
* Source/cmake/FindXkbCommon.cmake:

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



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

Reply via email to