Skip to content

MacOS M2 cross compile to x86_64-macos-none fails #105

@scomx

Description

@scomx

Mac M2 running Sequoia 15.5, zig 0.14.1.

Using the zig-webui repo, zig build run_minimal builds and runs fine. When trying to cross compile with -Dtarget=x86_64-macos-none the build will fail. Not sure if this is a zig, zig-webui or a "me" related issue (very new to the first two) but cross compiling a plain vanilla zig project to any platform works with no issues.

❯ zig build run_minimal -Dtarget=x86_64-macos-none
run_minimal
└─ run minimal
   └─ zig build-exe minimal Debug x86_64-macos-none
      └─ zig build-lib webui Debug x86_64-macos-none failure
error: error: unable to find framework 'Cocoa'. searched paths:  none
error: unable to find framework 'WebKit'. searched paths:  none

error: the following command exited with error code 1:
/opt/homebrew/Cellar/zig/0.14.1/bin/zig build-lib -cflags -DNO_SSL -- /Users/metx/.cache/zig/p/webui-2.5.0-beta.4-pxqD5bE4NwCVDCBguzzRmyOubiadAaVRNM0XMxqUv_GS/src/webui.c -cflags -DNO_CACHING -DNO_CGI -DUSE_WEBSOCKET -Wno-error=date-time -DUSE_WEBSOCKET -DNO_SSL -DNDEBUG -- /Users/metx/.cache/zig/p/webui-2.5.0-beta.4-pxqD5bE4NwCVDCBguzzRmyOubiadAaVRNM0XMxqUv_GS/src/civetweb/civetweb.c -cflags -- /Users/metx/.cache/zig/p/webui-2.5.0-beta.4-pxqD5bE4NwCVDCBguzzRmyOubiadAaVRNM0XMxqUv_GS/src/webview/wkwebview.m -ODebug -target x86_64-macos-none -mcpu baseline -I /Users/metx/.cache/zig/p/webui-2.5.0-beta.4-pxqD5bE4NwCVDCBguzzRmyOubiadAaVRNM0XMxqUv_GS/include -Mroot -framework Cocoa -framework WebKit -lc --cache-dir /Users/metx/Developer/zig/zig-webui/.zig-cache --global-cache-dir /Users/metx/.cache/zig --name webui -static --zig-lib-dir /opt/homebrew/Cellar/zig/0.14.1/lib/zig/ --listen=- 
Build Summary: 2/7 steps succeeded; 1 failed

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions