Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: c2ca66180788e36530095c657f662b04a63fd9e3
https://github.com/WebKit/WebKit/commit/c2ca66180788e36530095c657f662b04a63fd9e3
Author: Elliott Williams <[email protected]>
Date: 2026-09-24 (Thu, 24 Sep 2026)
Changed paths:
A Tools/Scripts/merge-universal-build
M Tools/Scripts/webkitdirs.pm
Log Message:
-----------
[build-webkit] Multi-arch CMake build support
https://bugs.webkit.org/show_bug.cgi?id=324642
rdar://187255579
Reviewed by Adrian Taylor.
CMake doesn't natively support builting multi-arch very well. It has the
CMAKE_OSX_ARCHITECTURES variable, but:
- It doesn't work for Swift (modules need actual file-level differences
based on the architectures being compiled, and CMake does not
implement this logic nor does swift-driver in it's single-invocation
mode).
- CMake still has a "primary" architecture that it uses to do things
such as compiler testing. With CMAKE_OSX_ARCHITECTURES, build
configuration can't take the active arch into account at all, which
our build does heavily.
Instead, support universal builds by building twice and merging the
build trees together. Conceptually this is quite simple: given multiple
build directories, merge their contents together, lipo-ing binaries as
you go, and re-sign when you're done.
Add a `merge-universal-build` tool which does this. Teach build-webkit
to call it when building the Cocoa CMake port with more than one
architecture passed. The end result is a universal build directory with
valid signatures.
Extend build-webkit's logic for resetting CMake's cache to transparently
support multiple build directories, also.
* Tools/Scripts/merge-universal-build: Added.
(usage):
(MergeState):
(is_mach_o):
(run):
(architectures_of):
(needs_update):
(relative_paths):
(merge_file):
(enclosing_bundles):
(sign):
(main):
(main.depth):
* Tools/Scripts/webkitdirs.pm:
(universalArchitectures):
(perArchitectureProductDir):
(buildCMakeProjectOrExit):
(buildUniversalCMakeProject):
(removeCMakeCacheIfNeeded):
(removeCMakeCache):
Canonical link: https://commits.webkit.org/321824@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications