From e2ebf6d24af55ea2892192d15737fd96661404ac Mon Sep 17 00:00:00 2001
From: Calin Martinconi
However, these are separate tools, that do not belong to C/C++ compilers, like gcc
or clang
. As a result, in C/C++ projects, you have not only to install and manage your C/C++ compilers, but you also have to install and manage these build systems separately.
But instead of using a separate build system, in Zig, we use the Zig language itself to write build scripts. In other words, Zig contains a native build system in it. And we can use this build system to write small scripts in Zig, which describes the necessary steps to build/compile our Zig project2. So, everything you need to build a complex Zig project is the zig
compiler, and nothing more.
Now that we described this topic in more depth, let’s focus on the second generated file (build.zig.zon
), which is the Zig package manager configuration file, where you can list and manage the dependencies of your project. Yes, Zig have a package manager (like pip
in Python, cargo
in Rust, or npm
in Javascript) called Zon, and this build.zig.zon
file is similar to the package.json
file in Javascript projects, or, the Pipfile
in Python projects.
Now that we described this topic in more depth, let’s focus on the second generated file (build.zig.zon
), which is the Zig package manager configuration file, where you can list and manage the dependencies of your project. Yes, Zig has a package manager (like pip
in Python, cargo
in Rust, or npm
in Javascript) called Zon, and this build.zig.zon
file is similar to the package.json
file in Javascript projects, or, the Pipfile
in Python projects.
root.zig
file