-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.zig
More file actions
68 lines (63 loc) · 1.93 KB
/
Copy pathbuild.zig
File metadata and controls
68 lines (63 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// SPDX-License-Identifier: 0BSD
// SPDX-FileCopyrightText: CascadeOS Contributors
const std = @import("std");
pub fn build(b: *std.Build) void {
const optimize = b.standardOptimizeOption(.{ .preferred_optimize_mode = .ReleaseSafe });
const freestanding_target = blk: {
var target = b.standardTargetOptions(.{});
target.query.os_tag = .freestanding;
target.result.os.tag = .freestanding;
break :blk target;
};
const include_directory = b.path("include");
const libcascade_module = b.createModule(.{
.root_source_file = null,
.target = freestanding_target,
.optimize = optimize,
.link_libc = false,
.link_libcpp = false,
.sanitize_c = .off,
.strip = false,
.no_builtin = true,
.stack_protector = false,
.stack_check = false,
.pic = true,
});
libcascade_module.addIncludePath(include_directory);
libcascade_module.addCSourceFiles(.{
.files = &.{
"src/debug.c",
"src/thread.c",
},
.flags = &.{
"-ffreestanding",
"-fno-builtin",
"-fno-stack-protector",
"-fno-stack-check",
"-pedantic",
"-Wall",
"-Wextra",
"-Wpedantic",
"-Wunused-parameter",
"-Wunused-result",
"-Wstrict-prototypes",
"-Wmissing-prototypes",
"-Wswitch-default",
"-Wswitch-enum",
"-Wconversion",
"-Wdouble-promotion",
"-Wundef",
"-Wunused",
"-Warray-bounds",
"-Werror",
"-std=c99",
},
});
const c_libcascade = b.addLibrary(.{
.name = "cascade",
.linkage = .static,
.root_module = libcascade_module,
});
c_libcascade.installHeadersDirectory(include_directory, "", .{});
b.installArtifact(c_libcascade);
}