Skip to content

wraps `zig cc` to be able to be called by the nim compiler

Notifications You must be signed in to change notification settings

enthus1ast/zigcc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

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

About

wraps `zig cc` to be able to be called by the nim compiler

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages