Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 26455eaa4d9bc90285fc2d78d95f45f65f78d8c2
      
https://github.com/WebKit/WebKit/commit/26455eaa4d9bc90285fc2d78d95f45f65f78d8c2
  Author: Richard Robinson <[email protected]>
  Date:   2026-07-04 (Sat, 04 Jul 2026)

  Changed paths:
    M Source/WebKit/PlatformCocoa.cmake
    M Source/WebKit/PlatformMac.cmake
    M Source/cmake/OptionsMac.cmake

  Log Message:
  -----------
  [CMake] Produce the Swift module and interface for WebKit.framework
https://bugs.webkit.org/show_bug.cgi?id=318591
rdar://181374997

Reviewed by Pascoe.

This allows Swift code to actually consume WebKit, for example:

```
echo 'import WebKit' | xcrun swiftc -typecheck -target arm64-apple-macosx27.0 
-F WebKitBuild/cmake-mac/Debug -
```

by actually producing the WebKit Swift module and its Swift interface and 
copying
it to the right location, mirroring what Xcode does.

This also produces the WebKit's public and private Clang module, and its SwiftUI
cross-import overlay file, like Xcode.

Also, add support for WebKit's custom Swift availability attributes.

All of this is a prerequisite for adding support for building `_WebKit_SwiftUI`
and consequently TestWebKitAPI's Swift support, and SwiftBrowser.

Currently, most of WebKit's Swift files still aren't compiled. This won't be 
possible
until the CMake build moves to having actual proper framework directories so 
that
it's possible for Swift files to import WebKit's public and private clang 
modules.

* Source/WebKit/PlatformCocoa.cmake:

* Source/WebKit/PlatformMac.cmake:

- Build WebKit's Swift with library evolution and emit module interfaces
- Give the generated -define-availability flags to swiftc
- Add the WebKit_StageModules target that reproduces Xcode's Modules/ layout 
after WebKit is linked
- Creates the top-level WebKit.framework/Modules symlink.

* Source/cmake/OptionsMac.cmake:

- Add WEBKIT_SWIFT_MODULE_TRIPLE beside CMAKE_Swift_COMPILER_TARGET

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



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

Reply via email to