mirror of
https://github.com/jetzig-framework/zmd.git
synced 2025-12-28 18:41:32 -06:00
45 lines
1.2 KiB
Zig
45 lines
1.2 KiB
Zig
const std = @import("std");
|
|
|
|
pub const zmd = @import("src/zmd.zig");
|
|
|
|
pub fn build(b: *std.Build) void {
|
|
const target = b.standardTargetOptions(.{});
|
|
const optimize = b.standardOptimizeOption(.{});
|
|
|
|
const lib = b.addLibrary(.{
|
|
.name = "zmd",
|
|
.root_module = b.createModule(.{
|
|
.root_source_file = b.path("src/zmd.zig"),
|
|
.target = target,
|
|
.optimize = optimize,
|
|
}),
|
|
.use_llvm = false,
|
|
});
|
|
|
|
b.installArtifact(lib);
|
|
|
|
const lib_unit_tests = b.addTest(.{
|
|
.root_module = b.createModule(.{
|
|
.root_source_file = b.path("src/zmd.zig"),
|
|
.target = target,
|
|
.optimize = optimize,
|
|
}),
|
|
});
|
|
|
|
_ = b.addModule("zmd", .{ .root_source_file = b.path("src/zmd.zig") });
|
|
|
|
const run_lib_unit_tests = b.addRunArtifact(lib_unit_tests);
|
|
|
|
const test_step = b.step("test", "Run unit tests");
|
|
test_step.dependOn(&run_lib_unit_tests.step);
|
|
|
|
const docs_step = b.step("docs", "Generate documentation");
|
|
const docs_install = b.addInstallDirectory(.{
|
|
.source_dir = lib.getEmittedDocs(),
|
|
.install_dir = .prefix,
|
|
.install_subdir = "docs",
|
|
});
|
|
|
|
docs_step.dependOn(&docs_install.step);
|
|
}
|