https://github.com/wojtekmach/mix_zig_cc
https://github.com/wojtekmach/mix_zig_cc
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/wojtekmach/mix_zig_cc
- Owner: wojtekmach
- Created: 2021-05-12T11:19:36.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-05-15T09:03:50.000Z (over 4 years ago)
- Last Synced: 2025-03-06T17:53:49.213Z (7 months ago)
- Language: Elixir
- Size: 14.6 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# MixZigCC
A proof of concept of using [`zig cc`](https://andrewkelley.me/post/zig-cc-powerful-drop-in-replacement-gcc-clang.html) to cross-compile NIFs for these targets:
- `aarch64-linux`
- `x86_64-linux`
- `x86_64-macos`See [`examples/hello/c_src/hello_nif.c`](examples/hello/c_src/hello_nif.c), [`examples/hello/mix.exs`](examples/hello/mix.exs).
## Usage
iex> Mix.install([{:hello, github: "wojtekmach/mix_zig_cc", sparse: "examples/hello"}])
iex> Hello.hello
:worldWith Docker:
$ docker run --rm -it elixir:1.12 iex
iex> Mix.install([{:hello, github: "wojtekmach/mix_zig_cc", sparse: "examples/hello"}])
iex> Hello.hello
:world