Replies: 5 comments 7 replies
-
|
There's also the legal aspect too. You'd need to have a mac anyway to be allowed to use the SDKs... |
Beta Was this translation helpful? Give feedback.
-
|
You don't need a Mac to download the SDK. |
Beta Was this translation helpful? Give feedback.
-
|
if you know the type signatures of the functions you need to call, the symbol names and where the location of the library will be on MacOS, then it's possible to create |
Beta Was this translation helpful? Give feedback.
-
|
I'm glad I'm not the only one who is having these issues with webview as bad as this is to say. On the plus side I did find out that zig flags can be much less complicated before running into the missing objc and resolv problem. Mac min version can be specified on the target and isysroot, iwithsysroot, iframeworkwithsysroot for including the SDK plus local system libraries. Here are my docker files for cross compilation: This honestly feels like 100% an Apple issue for not providing the libraries needed in the SDK for cross compilation. I'm also not smart enough to figure out how to inject those into the SDK. It's also too bad WebView2 was never made available for Linux and Mac, but even worse Microsoft never opensourced it either. You can legally download Xcode by creating an Apple account (no device required) then extract the SDK from it. I don't think that breaks ULA, but still objc and resolv issue persists... |
Beta Was this translation helpful? Give feedback.
-
|
@jidckii I think I have the magic zig args for cross compiling to Darwin. I haven't tested it with wails yet, but it's working with WebView and squeek dialog which uses Cocoa. Also didn't need to set CGO_CFLAGS, CGO_CXXFLAGS, or CGO_LDFLAGS at all.
You can check out my docker file for the full build. https://gitlab.com/figuerom16/litequack/-/blob/main/docker/darwin |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
Has anyone had success with cross-compiling a Wails app from Linux to macOS?
I've tried both Zig and osxcross, and in both cases I eventually run into very similar issues — typically related to missing macOS system libraries like objc or resolv.
zig
Here’s an example using Zig:
This results in the following error:
osxcross (clang)
Here’s an example using osxcross:
error:
As far as I understand, Apple deliberately does not allow cross-compiling modern macOS GUI applications outside of their own tools.
___isPlatformVersionAtLeast is used in frameworks like AppKit, WebKit, and UniformTypeIdentifiers.
So, we can cross-compile CLI software, but if it's something GUI-related — like Wails, for example — then it's impossible to do without a real macOS.
Maybe it makes sense to use the old sdk 10.15 for example?
Beta Was this translation helpful? Give feedback.
All reactions