aboutsummaryrefslogtreecommitdiff
path: root/doc/langref.html.in
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2023-01-31 12:48:46 -0700
committerAndrew Kelley <andrew@ziglang.org>2023-01-31 15:09:35 -0700
commit9a29f4e0387f0480273ca4347ee43e4917cad8e2 (patch)
tree810a47c374686d744c3405df1c349936b0c941ec /doc/langref.html.in
parent5129fae4e8fdb68db1efdff20679b13487501691 (diff)
downloadzig-9a29f4e0387f0480273ca4347ee43e4917cad8e2.tar.gz
zig-9a29f4e0387f0480273ca4347ee43e4917cad8e2.zip
langref updates for new std.Build API
Diffstat (limited to 'doc/langref.html.in')
-rw-r--r--doc/langref.html.in17
1 files changed, 12 insertions, 5 deletions
diff --git a/doc/langref.html.in b/doc/langref.html.in
index 1163ad0200..00a263bae2 100644
--- a/doc/langref.html.in
+++ b/doc/langref.html.in
@@ -10560,8 +10560,9 @@ pub fn build(b: *std.Build) void {
// for restricting supported target set are available.
const target = b.standardTargetOptions(.{});
- // Standard release options allow the person running `zig build` to select
- // between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall.
+ // Standard optimization options allow the person running `zig build` to select
+ // between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall. Here we do not
+ // set a preferred release mode, allowing the user to decide how to optimize.
const optimize = b.standardOptimizeOption(.{});
const exe = b.addExecutable(.{
@@ -10964,8 +10965,11 @@ int main(int argc, char **argv) {
const std = @import("std");
pub fn build(b: *std.Build) void {
- const lib = b.addSharedLibrary("mathtest", "mathtest.zig", b.version(1, 0, 0));
-
+ const lib = b.addSharedLibrary(.{
+ .name = "mathtest",
+ .root_source_file = .{ .path = "mathtest.zig" },
+ .version = .{ .major = 1, .minor = 0, .patch = 0 },
+ });
const exe = b.addExecutable(.{
.name = "test",
});
@@ -11028,7 +11032,10 @@ int main(int argc, char **argv) {
const std = @import("std");
pub fn build(b: *std.Build) void {
- const obj = b.addObject("base64", "base64.zig");
+ const obj = b.addObject(.{
+ .name = "base64",
+ .root_source_file = .{ .path = "base64.zig" },
+ });
const exe = b.addExecutable(.{
.name = "test",