From 249b62bb0d1c1cb14f43831c8bcf58330e9b0cf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20T=C3=A1mara?= Date: Thu, 5 Dec 2024 23:43:07 -0500 Subject: [PATCH] zig: update according to current and next release (#14991) --- pages/common/zig.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pages/common/zig.md b/pages/common/zig.md index 42b43439b4..08d9bd9066 100644 --- a/pages/common/zig.md +++ b/pages/common/zig.md @@ -11,25 +11,25 @@ `zig build run` -- Initialize a `zig build` application: +- Initialize a `zig build` project with library and executable: -`zig init-exe` - -- Initialize a `zig build` library: - -`zig init-lib` +`zig init` - Create and run a test build: `zig test {{path/to/file.zig}}` +- Cross compile, build and run a project for `x86_64` architecture and `windows` operating system: + +`zig build run -fwine -Dtarget=x86_64-windows` + - Reformat Zig source into canonical form: `zig fmt {{path/to/file.zig}}` -- Use Zig as a drop-in C compiler: +- Translate a C file to `zig`: -`zig cc {{path/to/file.c}}` +`zig translate-c -lc {{path/to/file.c}}` - Use Zig as a drop-in C++ compiler: