-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
enhancementSolving this issue will likely involve adding new logic or components to the codebase.Solving this issue will likely involve adding new logic or components to the codebase.zig build systemstd.Build, the build runner, `zig build` subcommand, package managementstd.Build, the build runner, `zig build` subcommand, package management
Milestone
Description
Extracted from #14265.
Terminology clarification: #14307
Something like this:
build.zig.zon
.{
.name = "clap",
.url = "...",
.hash = "...",
}build.zig
// "clap" here references the dependency.name field of the build.zig.zon file.
const clap_pkg = b.dependency("clap", .{});
const exe = b.addExecutable("app", "src/main.zig");
// "clap" here is the string used when calling b.addModule (see code snippet below)
const clap_module = clap_pkg.module("clap");
// "clap" here is the name used for `@import` within src/main.zig
exe.addModule("clap", clap_module);The build.zig file for clap:
const module = b.addModule("clap", ".", "clap.zig");
const example = b.addExecutable("simple", "example/simple.zig");
example.addModule("clap", module);
example.setBuildMode(mode);
example.setTarget(target);
example.install();See #14282 for depending on pure zig modules without executing build.zig logic.
See #14286 for running build.zig logic in a sandbox.
Metadata
Metadata
Assignees
Labels
enhancementSolving this issue will likely involve adding new logic or components to the codebase.Solving this issue will likely involve adding new logic or components to the codebase.zig build systemstd.Build, the build runner, `zig build` subcommand, package managementstd.Build, the build runner, `zig build` subcommand, package management
Type
Projects
Status
Urgent Enhancements