mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
Add include paths to freetype module
This commit is contained in:
@ -5,7 +5,7 @@ pub fn build(b: *std.Build) !void {
|
|||||||
const optimize = b.standardOptimizeOption(.{});
|
const optimize = b.standardOptimizeOption(.{});
|
||||||
const libpng_enabled = b.option(bool, "enable-libpng", "Build libpng") orelse false;
|
const libpng_enabled = b.option(bool, "enable-libpng", "Build libpng") orelse false;
|
||||||
|
|
||||||
_ = b.addModule("freetype", .{ .root_source_file = .{ .path = "main.zig" } });
|
const module = b.addModule("freetype", .{ .root_source_file = .{ .path = "main.zig" } });
|
||||||
|
|
||||||
const upstream = b.dependency("freetype", .{});
|
const upstream = b.dependency("freetype", .{});
|
||||||
const lib = b.addStaticLibrary(.{
|
const lib = b.addStaticLibrary(.{
|
||||||
@ -15,6 +15,8 @@ pub fn build(b: *std.Build) !void {
|
|||||||
});
|
});
|
||||||
lib.linkLibC();
|
lib.linkLibC();
|
||||||
lib.addIncludePath(upstream.path("include"));
|
lib.addIncludePath(upstream.path("include"));
|
||||||
|
module.addIncludePath(upstream.path("include"));
|
||||||
|
module.addIncludePath(.{ .path = "" });
|
||||||
|
|
||||||
// Dependencies
|
// Dependencies
|
||||||
const zlib_dep = b.dependency("zlib", .{ .target = target, .optimize = optimize });
|
const zlib_dep = b.dependency("zlib", .{ .target = target, .optimize = optimize });
|
||||||
@ -38,12 +40,11 @@ pub fn build(b: *std.Build) !void {
|
|||||||
});
|
});
|
||||||
if (libpng_enabled) try flags.append("-DFT_CONFIG_OPTION_USE_PNG=1");
|
if (libpng_enabled) try flags.append("-DFT_CONFIG_OPTION_USE_PNG=1");
|
||||||
|
|
||||||
for (srcs) |src| {
|
lib.addCSourceFiles(.{
|
||||||
lib.addCSourceFile(.{
|
.dependency = upstream,
|
||||||
.file = upstream.path(src),
|
.files = srcs,
|
||||||
.flags = flags.items,
|
.flags = flags.items,
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
switch (target.result.os.tag) {
|
switch (target.result.os.tag) {
|
||||||
.linux => lib.addCSourceFile(.{
|
.linux => lib.addCSourceFile(.{
|
||||||
|
Reference in New Issue
Block a user