znvim/build.zig

30 lines
840 B
Zig
Raw Normal View History

2023-04-23 16:11:05 +02:00
const std = @import("std");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const nvim_c_mod = b.addModule("nvim_c", .{
2024-06-21 17:14:27 +02:00
.root_source_file = b.path("nvim_c.zig"),
2024-01-07 20:39:32 +01:00
.link_libc = true,
2023-04-23 16:11:05 +02:00
});
_ = b.addModule("znvim", .{
2024-06-21 17:14:27 +02:00
.root_source_file = b.path("src/main.zig"),
2024-01-07 20:39:32 +01:00
.imports = &.{.{ .name = "nvim_c", .module = nvim_c_mod }},
2023-04-23 16:11:05 +02:00
});
const main_tests = b.addTest(.{
2024-06-21 17:14:27 +02:00
.root_source_file = b.path("src/main.zig"),
2023-04-23 16:11:05 +02:00
.target = target,
.optimize = optimize,
});
2024-01-07 20:39:32 +01:00
main_tests.root_module.addImport("nvim_c", nvim_c_mod);
2023-04-23 16:11:05 +02:00
const run_main_tests = b.addRunArtifact(main_tests);
const test_step = b.step("test", "Run library tests");
test_step.dependOn(&run_main_tests.step);
}