freetype: rename freetype_pkg to pkg
This commit is contained in:
parent
772a821ce1
commit
d98bfab809
3 changed files with 13 additions and 6 deletions
|
|
@ -40,7 +40,7 @@ pub fn build(b: *std.build.Builder) void {
|
|||
.{ .name = "instanced-cube", .packages = &[_]Pkg{Packages.zmath} },
|
||||
.{ .name = "advanced-gen-texture-light", .packages = &[_]Pkg{Packages.zmath} },
|
||||
.{ .name = "fractal-cube", .packages = &[_]Pkg{Packages.zmath} },
|
||||
.{ .name = "gkurve", .packages = &[_]Pkg{ Packages.zmath, Packages.zigimg, freetype.freetype_pkg }, .std_platform_only = true },
|
||||
.{ .name = "gkurve", .packages = &[_]Pkg{ Packages.zmath, Packages.zigimg, freetype.pkg }, .std_platform_only = true },
|
||||
.{ .name = "textured-cube", .packages = &[_]Pkg{ Packages.zmath, Packages.zigimg } },
|
||||
}) |example| {
|
||||
// FIXME: this is workaround for a problem that some examples (having the std_platform_only=true field) as
|
||||
|
|
@ -62,7 +62,7 @@ pub fn build(b: *std.build.Builder) void {
|
|||
);
|
||||
example_app.setBuildMode(mode);
|
||||
inline for (example.packages) |p| {
|
||||
if (std.mem.eql(u8, p.name, freetype.freetype_pkg.name))
|
||||
if (std.mem.eql(u8, p.name, freetype.pkg.name))
|
||||
freetype.link(example_app.b, example_app.step, .{});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,6 +33,13 @@ pub fn build(b: *Builder) void {
|
|||
}
|
||||
```
|
||||
|
||||
and optionaly add harfbuzz:
|
||||
|
||||
```zig
|
||||
exe.addPackage(freetype.harfbuzz_pkg);
|
||||
freetype.link(b, exe, .{ .harfbuzz = .{} });
|
||||
```
|
||||
|
||||
<details>
|
||||
<description>Optional: Using Gyro dependency manager</description>
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ const ft_include_path = ft_root ++ "/include";
|
|||
const hb_root = thisDir() ++ "/upstream/harfbuzz";
|
||||
const hb_include_path = ft_root ++ "/src";
|
||||
|
||||
pub const freetype_pkg = std.build.Pkg{
|
||||
pub const pkg = std.build.Pkg{
|
||||
.name = "freetype",
|
||||
.source = .{ .path = thisDir() ++ "/src/freetype/main.zig" },
|
||||
};
|
||||
|
|
@ -31,7 +31,7 @@ pub fn build(b: *std.build.Builder) !void {
|
|||
const mode = b.standardReleaseOptions();
|
||||
const target = b.standardTargetOptions(.{});
|
||||
|
||||
const freetype_tests = b.addTestSource(freetype_pkg.source);
|
||||
const freetype_tests = b.addTestSource(pkg.source);
|
||||
freetype_tests.setBuildMode(mode);
|
||||
freetype_tests.setTarget(target);
|
||||
link(b, freetype_tests, .{});
|
||||
|
|
@ -39,7 +39,7 @@ pub fn build(b: *std.build.Builder) !void {
|
|||
const main_tests = b.addTest("test/main.zig");
|
||||
main_tests.setBuildMode(mode);
|
||||
main_tests.setTarget(target);
|
||||
main_tests.addPackage(freetype_pkg);
|
||||
main_tests.addPackage(pkg);
|
||||
link(b, main_tests, .{ .freetype = .{ .ft_config_path = "./test/ft" } });
|
||||
|
||||
const test_step = b.step("test", "Run library tests");
|
||||
|
|
@ -53,7 +53,7 @@ pub fn build(b: *std.build.Builder) !void {
|
|||
const example_exe = b.addExecutable("example-" ++ example, "examples/" ++ example ++ ".zig");
|
||||
example_exe.setBuildMode(mode);
|
||||
example_exe.setTarget(target);
|
||||
example_exe.addPackage(freetype_pkg);
|
||||
example_exe.addPackage(pkg);
|
||||
link(b, example_exe, .{});
|
||||
example_exe.install();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue