1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-22 23:02:07 +02:00
tldr/pages/common/zig.md
2021-09-24 07:04:28 +02:00

607 B

zig

The Zig compiler and toolchain. More information: https://ziglang.org.

  • Compile the project in the current directory:

zig build

  • Compile and run the project in the current directory:

zig build run

  • Initialize a zig build application:

zig init-exe

  • Intitialize a zig build library:

zig init-lib

  • Create and run a test build:

zig test {{path/to/file.zig}}

  • Reformat Zig source into canonical form:

zig fmt {{path/to/file.zig}}

  • Use Zig as a drop-in C compiler:

zig cc {{path/to/file.c}}

  • Use Zig as a drop-in C++ compiler:

zig c++ {{path/to/file.cpp}}