-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.zig
32 lines (29 loc) · 1.62 KB
/
build.zig
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
//:_______________________________________________________________________
// ᛟ minim | Copyright (C) Ivan Mar (sOkam!) | GNU LGPLv3 or later :
//:_______________________________________________________________________
//! @fileoverview
//! - Adds zls support
//! - Adds support for building with confy from Zig's buildsystem
//! This file is not needed at all to build or use the project
//_________________________________________________________________|
pub fn build (B :*@import("std").Build) !void {
// Declare the project's confy builder
const confy = B.addExecutable(.{
.name = "confy-builder",
.root_source_file = B.path("./src/build.zig"),
.target = B.standardTargetOptions(.{}),
.optimize = B.standardOptimizeOption(.{}),
});
B.installArtifact(confy);
// Dependencies: Builder
confy.root_module.addImport("zstd", B.addModule("zstd", .{.root_source_file= B.path("./bin/.lib/zstd/src/zstd.zig") }));
confy.root_module.addImport("confy", B.addModule("confy", .{.root_source_file= B.path("./bin/.lib/confy/src/confy.zig") }));
// Dependencies: Project (LSP support: zls)
confy.root_module.addImport("zstd", B.addModule("zstd", .{.root_source_file= B.path("./bin/.lib/zstd/src/zstd.zig") }));
confy.root_module.addImport("slate", B.addModule("slate", .{.root_source_file= B.path("./bin/.lib/slate/src/slate.zig") }));
// Add support for `zig build run (-- arg1 arg2 arg3)`
const R = B.addRunArtifact(confy);
R.step.dependOn(B.getInstallStep());
if (B.args) |arg| R.addArgs(arg);
B.step("run", "Run the project's confy builder").dependOn(&R.step);
}