Created
October 15, 2024 15:44
-
-
Save Brugarolas/3767dca42b6d676f993cb5d11aa765bb to your computer and use it in GitHub Desktop.
Zig build for string library
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const std = @import("std"); | |
| pub fn build(b: *std.Build) void { | |
| const target = b.standardTargetOptions(.{}); | |
| const optimize = b.standardOptimizeOption(.{}); | |
| // Add static library | |
| const lib = b.addStaticLibrary(.{ | |
| .name = "zig-string", | |
| .root_source_file = b.path("src/string.zig"), | |
| .target = target, | |
| .optimize = optimize, | |
| }); | |
| b.installArtifact(lib); | |
| // Add and run unit tests | |
| const unit_tests = b.addTest(.{ | |
| .root_source_file = b.path("src/test.zig"), | |
| .target = target, | |
| .optimize = optimize, | |
| }); | |
| b.default_step.dependOn(&unit_tests.step); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment