Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 62e2ae37bc7e35296509afb798d2878b19a2987a
      
https://github.com/WebKit/WebKit/commit/62e2ae37bc7e35296509afb798d2878b19a2987a
  Author: Qianlang Chen <[email protected]>
  Date:   2026-05-13 (Wed, 13 May 2026)

  Changed paths:
    A Source/WebInspectorUI/PlatformMac.cmake
    R Source/WebInspectorUI/WebInspectorUI.c
    A Source/WebInspectorUI/WebInspectorUI.cpp
    A Source/WebInspectorUI/WebInspectorUI.h
    M Source/WebInspectorUI/WebInspectorUI.xcodeproj/project.pbxproj
    M Source/WebKit/PlatformMac.cmake

  Log Message:
  -----------
  [Mac][CMake] Build WebInspectorUI.fw on macOS so inspector works in CMade 
MiniBrowser
https://bugs.webkit.org/show_bug.cgi?id=313833

Reviewed by BJ Burg.

The CMake Mac build originally produced the inspector resource files but
never assembled them into a WebInspectorUI.framework bundle. At runtime,
WKInspectorResourceURLSchemeHandler looked up the bundle by identifier
(com.apple.WebInspectorUI), which only found bundles already loaded by
dyld. In the Xcode build, -weak_framework WebInspectorUI let dyld
load it, but in the CMake build, nothing did, so the lookup returned nil
and hit RELEASE_ASSERT. Opening Web Inspector in a CMake-built
MiniBrowser resulted in a crash.

With this change, a CMake-built MiniBrowser can open Web Inspector out
of the box. Example:
    cmake --preset mac-dev-release
    cmake --build --preset mac-dev-release
    DYLD_FRAMEWORK_PATH=WebKitBuild/cmake-mac/Release \
        WebKitBuild/cmake-mac/Release/MiniBrowser.app/Contents/MacOS/MiniBrowser

Layout tests also work with the CMake build via --root:
    run-webkit-tests --release --root WebKitBuild/cmake-mac/Release \
        inspector/console/console-message.html

No new tests; build system change only.

* Source/WebInspectorUI/PlatformMac.cmake:
Build a WebInspectorUI.framework with a stub dylib and the standard
Versions/A symlink structure, then copy inspector resources into it.

* Source/WebInspectorUI/WebInspectorUI.cpp: Copied from 
Source/WebInspectorUI/WebInspectorUI.c.
(WebInspectorUIFrameworkLoad):
* Source/WebInspectorUI/WebInspectorUI.h: Copied from 
Source/WebInspectorUI/WebInspectorUI.c.
* Source/WebInspectorUI/WebInspectorUI.xcodeproj/project.pbxproj:
* Source/WebKit/PlatformMac.cmake:
- Because the CMake build passes -dead_strip_dylibs globally
  (OptionsMac.cmake), the linker would prune the unused weak dependency.
  Export a dummy symbol to let WebKit reference it via -Wl,-u to keep
  the load command alive.
- Rename WebInspectorUI.c to .cpp so TAPI's C++ header scan and the
  source agree on symbol linkage.

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



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

Reply via email to