https://github.com/mbround18/setup-osxcross
Github Action for setting up osxcross in a github action for cross compiling from Linux to Mac
https://github.com/mbround18/setup-osxcross
c cross-platform github github-actions linux mac rust
Last synced: 10 months ago
JSON representation
Github Action for setting up osxcross in a github action for cross compiling from Linux to Mac
- Host: GitHub
- URL: https://github.com/mbround18/setup-osxcross
- Owner: mbround18
- License: bsd-3-clause
- Created: 2022-08-09T15:42:31.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-02-18T02:51:23.000Z (almost 2 years ago)
- Last Synced: 2024-05-01T16:25:58.015Z (over 1 year ago)
- Topics: c, cross-platform, github, github-actions, linux, mac, rust
- Homepage:
- Size: 35.2 KB
- Stars: 16
- Watchers: 2
- Forks: 6
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Setup osxcross
Github Action for setting up osxcross in a github action.
## Sources & Shoutouts
- [Thank you to James Waples for posting this article!](https://wapl.es/rust/2019/02/17/rust-cross-compile-linux-to-macos.html)
## Usage
```yaml
# Setup Rust, use the x86_64-apple-darwin target but the rest can be customized.
- uses: ATiltedTree/setup-rust@v1
with:
targets: x86_64-apple-darwin
rust-version: nightly
# Use the v1 of this action
- uses: mbround18/setup-osxcross@v1
# This builds executables & sets env variables for rust to consume.
with:
osx-version: "12.3"
# Checkout your code
- name: Clone your Code
uses: actions/checkout@v3
# Build your code for apple-darwin based release
- name: Build Your Code
run: cargo build --release --target x86_64-apple-darwin
```
## ZLIB and C/++ compilations
If you run into issues were you have zlib or have c as a dependenacy consider setting the following in your env.
```sh
# Make libz-sys (git2-rs -> libgit2-sys -> libz-sys) build as a statically linked lib
# This prevents the host zlib from being linked
export LIBZ_SYS_STATIC=1
# Use Clang for C/C++ builds
export CC=o64-clang
export CXX=o64-clang++
```