mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 15:56:13 +03:00
build: copy header files, build static lib too
This commit is contained in:
52
build.zig
52
build.zig
@ -430,20 +430,48 @@ pub fn build(b: *std.Build) !void {
|
||||
|
||||
// libghostty (non-Darwin)
|
||||
if (!builtin.target.isDarwin() and config.app_runtime == .none) {
|
||||
const lib = b.addSharedLibrary(.{
|
||||
.name = "ghostty",
|
||||
.root_source_file = .{ .path = "src/main_c.zig" },
|
||||
.optimize = optimize,
|
||||
.target = target,
|
||||
});
|
||||
lib.root_module.addOptions("build_options", exe_options);
|
||||
_ = try addDeps(b, lib, config);
|
||||
// Shared
|
||||
{
|
||||
const lib = b.addSharedLibrary(.{
|
||||
.name = "ghostty",
|
||||
.root_source_file = .{ .path = "src/main_c.zig" },
|
||||
.optimize = optimize,
|
||||
.target = target,
|
||||
});
|
||||
lib.root_module.addOptions("build_options", exe_options);
|
||||
_ = try addDeps(b, lib, config);
|
||||
|
||||
const lib_install = b.addInstallLibFile(
|
||||
lib.getEmittedBin(),
|
||||
"libghostty.so",
|
||||
const lib_install = b.addInstallLibFile(
|
||||
lib.getEmittedBin(),
|
||||
"libghostty.so",
|
||||
);
|
||||
b.getInstallStep().dependOn(&lib_install.step);
|
||||
}
|
||||
|
||||
// Static
|
||||
{
|
||||
const lib = b.addStaticLibrary(.{
|
||||
.name = "ghostty",
|
||||
.root_source_file = .{ .path = "src/main_c.zig" },
|
||||
.optimize = optimize,
|
||||
.target = target,
|
||||
});
|
||||
lib.root_module.addOptions("build_options", exe_options);
|
||||
_ = try addDeps(b, lib, config);
|
||||
|
||||
const lib_install = b.addInstallLibFile(
|
||||
lib.getEmittedBin(),
|
||||
"libghostty.a",
|
||||
);
|
||||
b.getInstallStep().dependOn(&lib_install.step);
|
||||
}
|
||||
|
||||
// Copy our ghostty.h to include.
|
||||
const header_install = b.addInstallHeaderFile(
|
||||
"include/ghostty.h",
|
||||
"ghostty.h",
|
||||
);
|
||||
b.getInstallStep().dependOn(&lib_install.step);
|
||||
b.getInstallStep().dependOn(&header_install.step);
|
||||
}
|
||||
|
||||
// On Mac we can build the embedding library. This only handles the macOS lib.
|
||||
|
Reference in New Issue
Block a user