Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes linux to osx cross compilation #468

Merged
merged 1 commit into from
Jul 19, 2024
Merged

Conversation

birhburh
Copy link
Contributor

@birhburh birhburh commented Jul 18, 2024

So it can be build like this (adding for historic purpose):

rustup target add x86_64-apple-darwin
curl -L https://github.com/roblabla/MacOSX-SDKs/releases/download/13.1/MacOSX13.1.sdk.tar.xz | tar xJ
cargo install --locked cargo-zigbuild

# https://github.com/ziglang/zig/wiki/Install-Zig-from-a-Package-Manager
snap install zig --classic --beta 

export SDKROOT=$(pwd)/MacOSX13.1.sdk/

cargo zigbuild --release --target x86_64-apple-darwin 

It was an error:

note: error: unable to find framework 'CoreMidi'. searched paths: 
     .../MacOSX13.1.sdk/System/Library/Frameworks/CoreMidi.framework/CoreMidi.tbd
     .../MacOSX13.1.sdk/System/Library/Frameworks/CoreMidi.framework/CoreMidi.dylib
     .../MacOSX13.1.sdk/System/Library/Frameworks/CoreMidi.framework/CoreMidi

Tested on:

Linux:

uname -a
Linux vagrant 5.4.0-176-generic #196-Ubuntu SMP Fri Mar 22 16:46:39 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.6 LTS
Release:	20.04
Codename:	focal

MacOS:

uname -mprsv
Darwin 21.6.0 Darwin Kernel Version 21.6.0: Wed Apr 24 06:02:02 PDT 2024; root:xnu-8020.240.18.708.4~1/RELEASE_X86_64 x86_64 i386

sw_vers
ProductName:	macOS
ProductVersion:	12.7.5
BuildVersion:	21H1222

@not-fl3
Copy link
Owner

not-fl3 commented Jul 18, 2024

Hmm, do miniquad use anything from CoreMIDI?

@birhburh
Copy link
Contributor Author

I checked everything from this block

#[link(name = "CoreMidi", kind = "framework")]

And it seems it's not

@birhburh
Copy link
Contributor Author

Ok, removed CoreMidi, AVFoundation links
And also one unused link that i've added

@not-fl3 not-fl3 merged commit b923c10 into not-fl3:master Jul 19, 2024
10 checks passed
@not-fl3
Copy link
Owner

not-fl3 commented Jul 19, 2024

Perfect, thanks for PR!

@not-fl3
Copy link
Owner

not-fl3 commented Jul 21, 2024

btw, maybe you want to post build instructions and a few words about your experience cross-compiling to macos as an article for https://github.com/not-fl3/macroquad-website/tree/source/content/articles / http://macroquad.rs/articles/ ? I am curious how it all works!

@birhburh
Copy link
Contributor Author

@not-fl3, I could try
It was easy mainly thanks to awesome ziglang's C cross-compiler
I'll send a PR with an article

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants