File: build.zig

package info (click to toggle)
rust-codspeed 4.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,560 kB
  • sloc: ansic: 9,768; sh: 6; makefile: 2
file content (26 lines) | stat: -rw-r--r-- 959 bytes parent folder | download | duplicates (2)
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
const std = @import("std");

pub fn build(b: *std.Build) void {
    // Core Library
    //
    const libcore = b.addStaticLibrary(.{
        .name = "core",
        .root_source_file = b.path("src/c.zig"),
        .target = b.resolveTargetQuery(.{ .ofmt = .c }),
        .optimize = .ReleaseSmall,
        .link_libc = true,
        .strip = true,
        .pic = true,
    });
    libcore.no_builtin = true;
    b.installArtifact(libcore);

    // Tests
    //
    const test_main = b.addTest(.{ .root_source_file = b.path("src/root.zig"), .optimize = .ReleaseSafe, .link_libc = true, .test_runner = .{ .path = b.path("src/tests/runner.zig"), .mode = .simple } });
    test_main.addCSourceFile(.{ .file = b.path("src/helpers/valgrind_wrapper.c") });
    test_main.addIncludePath(b.path("includes"));
    test_main.linkLibC();
    const run_test_main = b.addRunArtifact(test_main);
    b.step("test", "test utility functions").dependOn(&run_test_main.step);
}