mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-03-08 01:24:49 +01:00
Merge branch 'ziglang:master' into some-documentation-updates-0
This commit is contained in:
commit
5381e7891d
358 changed files with 35994 additions and 11556 deletions
|
|
@ -4,8 +4,10 @@ pub fn build(b: *std.Build) void {
|
|||
const optimize = b.standardOptimizeOption(.{});
|
||||
const exe = b.addExecutable(.{
|
||||
.name = "example",
|
||||
.root_source_file = b.path("example.zig"),
|
||||
.optimize = optimize,
|
||||
.root_module = b.createModule(.{
|
||||
.root_source_file = b.path("example.zig"),
|
||||
.optimize = optimize,
|
||||
}),
|
||||
});
|
||||
b.default_step.dependOn(&exe.step);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,15 +4,19 @@ pub fn build(b: *std.Build) void {
|
|||
const lib = b.addLibrary(.{
|
||||
.linkage = .dynamic,
|
||||
.name = "mathtest",
|
||||
.root_source_file = b.path("mathtest.zig"),
|
||||
.root_module = b.createModule(.{
|
||||
.root_source_file = b.path("mathtest.zig"),
|
||||
}),
|
||||
.version = .{ .major = 1, .minor = 0, .patch = 0 },
|
||||
});
|
||||
const exe = b.addExecutable(.{
|
||||
.name = "test",
|
||||
.root_module = b.createModule(.{
|
||||
.link_libc = true,
|
||||
}),
|
||||
});
|
||||
exe.addCSourceFile(.{ .file = b.path("test.c"), .flags = &.{"-std=c99"} });
|
||||
exe.linkLibrary(lib);
|
||||
exe.linkSystemLibrary("c");
|
||||
exe.root_module.addCSourceFile(.{ .file = b.path("test.c"), .flags = &.{"-std=c99"} });
|
||||
exe.root_module.linkLibrary(lib);
|
||||
|
||||
b.default_step.dependOn(&exe.step);
|
||||
|
||||
|
|
|
|||
|
|
@ -3,15 +3,19 @@ const std = @import("std");
|
|||
pub fn build(b: *std.Build) void {
|
||||
const obj = b.addObject(.{
|
||||
.name = "base64",
|
||||
.root_source_file = b.path("base64.zig"),
|
||||
.root_module = b.createModule(.{
|
||||
.root_source_file = b.path("base64.zig"),
|
||||
}),
|
||||
});
|
||||
|
||||
const exe = b.addExecutable(.{
|
||||
.name = "test",
|
||||
.root_module = b.createModule(.{
|
||||
.link_libc = true,
|
||||
}),
|
||||
});
|
||||
exe.addCSourceFile(.{ .file = b.path("test.c"), .flags = &.{"-std=c99"} });
|
||||
exe.addObject(obj);
|
||||
exe.linkSystemLibrary("c");
|
||||
exe.root_module.addCSourceFile(.{ .file = b.path("test.c"), .flags = &.{"-std=c99"} });
|
||||
exe.root_module.addObject(obj);
|
||||
b.installArtifact(exe);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue