Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/enthus1ast/zigcc
wraps `zig cc` to be able to be called by the nim compiler
https://github.com/enthus1ast/zigcc
Last synced: 6 days ago
JSON representation
wraps `zig cc` to be able to be called by the nim compiler
- Host: GitHub
- URL: https://github.com/enthus1ast/zigcc
- Owner: enthus1ast
- Created: 2022-08-13T16:00:49.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-03-22T21:06:08.000Z (over 1 year ago)
- Last Synced: 2024-08-01T19:56:13.268Z (3 months ago)
- Language: Nim
- Size: 7.81 KB
- Stars: 35
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
installs
- `zigcc`
- `zigcpp`to your nimble dir.
Both are wrappers for calling zig:- `zig cc`
- `zig c++`also see this https://stackoverflow.com/questions/73345643/how-to-use-the-zig-compiler-in-order-to-compile-nim-code
# Installation
```
nimble install zigcc
```# windows
```
nim c --cc:clang --clang.exe="zigcc.cmd" --clang.linkerexe="zigcc.cmd" --forceBuild:on --opt:speed hello.nim
```# linux and rest
```
nim c --cc:clang --clang.exe="zigcc" --clang.linkerexe="zigcc" --forceBuild:on --opt:speed hello.nim
```# cross compilation example
build linux executables from windows:
```
nim c --cc:clang --clang.exe="zigcc.cmd" --clang.linkerexe="zigcc.cmd" --passc:"-target x86_64-linux-gnu" --passl:"-target x86_64-linux-gnu" --forceBuild:on --os:linux --opt:speed --out:hellolinux hello.nim
```build windows executables from linux:
```
nim c --cc:clang --clang.exe="zigcc" --clang.linkerexe="zigcc" --passc:"-target x86_64-windows" --passl:"-target x86_64-windows" --forceBuild:on --os:windows --opt:speed foo.nim
```