Skip to content

Commit 901ab52

Browse files
carson-katrikrichprollsch
authored andcommitted
Add build static-lib step
1 parent fa288c2 commit 901ab52

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

build.zig

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,25 @@ pub fn build(b: *Build) !void {
149149
const build_step = b.step("build-v8", "Build v8");
150150
build_step.dependOn(&build_v8.step);
151151
}
152+
153+
{
154+
// static lib
155+
// -------
156+
const static_lib_module = b.addModule("lightpanda", .{
157+
.root_source_file = b.path("src/lib.zig"),
158+
.target = target,
159+
.optimize = optimize,
160+
.link_libc = true,
161+
.link_libcpp = true,
162+
});
163+
try addDependencies(b, static_lib_module, opts);
164+
165+
const lib = b.addLibrary(.{ .name = "lightpanda", .root_module = static_lib_module, .use_llvm = true, .linkage = .static });
166+
lib.bundle_compiler_rt = true;
167+
const install_artifact = b.addInstallArtifact(lib, .{});
168+
const build_step = b.step("static-lib", "Build static lib");
169+
build_step.dependOn(&install_artifact.step);
170+
}
152171
}
153172

154173
fn addDependencies(b: *Build, mod: *Build.Module, opts: *Build.Step.Options) !void {

0 commit comments

Comments
 (0)