Merge pull request #217 from mitchellh/update-zig

Update Zig to nearly 0.11
This commit is contained in:
Mitchell Hashimoto
2023-08-02 17:52:44 -07:00
committed by GitHub
17 changed files with 113 additions and 78 deletions

2
.gitmodules vendored
View File

@ -42,4 +42,4 @@
url = https://github.com/hexops/sdk-linux-x86_64.git url = https://github.com/hexops/sdk-linux-x86_64.git
[submodule "vendor/mach-glfw"] [submodule "vendor/mach-glfw"]
path = vendor/mach-glfw path = vendor/mach-glfw
url = https://github.com/hexops/mach-glfw.git url = https://github.com/mitchellh/mach-glfw.git

View File

@ -36,7 +36,7 @@ const system_sdk = @import("vendor/mach-glfw/system_sdk.zig");
// but we liberally update it. In the future, we'll be more careful about // but we liberally update it. In the future, we'll be more careful about
// using released versions so that package managers can integrate better. // using released versions so that package managers can integrate better.
comptime { comptime {
const required_zig = "0.11.0-dev.4282+0f21d3d4d"; const required_zig = "0.11.0-dev.4404+4f6013bf5";
const current_zig = builtin.zig_version; const current_zig = builtin.zig_version;
const min_zig = std.SemanticVersion.parse(required_zig) catch unreachable; const min_zig = std.SemanticVersion.parse(required_zig) catch unreachable;
if (current_zig.order(min_zig) == .lt) { if (current_zig.order(min_zig) == .lt) {
@ -250,7 +250,7 @@ pub fn build(b: *std.Build) !void {
// If we're installing, we get the install step so we can add // If we're installing, we get the install step so we can add
// additional dependencies to it. // additional dependencies to it.
const install_step = if (app_runtime != .none) step: { const install_step = if (app_runtime != .none) step: {
const step = b.addInstallArtifact(exe); const step = b.addInstallArtifact(exe, .{});
b.getInstallStep().dependOn(&step.step); b.getInstallStep().dependOn(&step.step);
break :step step; break :step step;
} else null; } else null;
@ -392,7 +392,7 @@ pub fn build(b: *std.Build) !void {
// App (Mac) // App (Mac)
if (target.isDarwin()) { if (target.isDarwin()) {
const bin_install = b.addInstallFile( const bin_install = b.addInstallFile(
.{ .generated = &exe.output_path_source }, exe.getEmittedBin(),
"Ghostty.app/Contents/MacOS/ghostty", "Ghostty.app/Contents/MacOS/ghostty",
); );
b.getInstallStep().dependOn(&bin_install.step); b.getInstallStep().dependOn(&bin_install.step);
@ -419,7 +419,7 @@ pub fn build(b: *std.Build) !void {
// Create a single static lib with all our dependencies merged // Create a single static lib with all our dependencies merged
var lib_list = try addDeps(b, lib, true); var lib_list = try addDeps(b, lib, true);
try lib_list.append(.{ .generated = &lib.output_path_source }); try lib_list.append(lib.getEmittedBin());
const libtool = LibtoolStep.create(b, .{ const libtool = LibtoolStep.create(b, .{
.name = "ghostty", .name = "ghostty",
.out_name = "libghostty-aarch64-fat.a", .out_name = "libghostty-aarch64-fat.a",
@ -448,7 +448,7 @@ pub fn build(b: *std.Build) !void {
// Create a single static lib with all our dependencies merged // Create a single static lib with all our dependencies merged
var lib_list = try addDeps(b, lib, true); var lib_list = try addDeps(b, lib, true);
try lib_list.append(.{ .generated = &lib.output_path_source }); try lib_list.append(lib.getEmittedBin());
const libtool = LibtoolStep.create(b, .{ const libtool = LibtoolStep.create(b, .{
.name = "ghostty", .name = "ghostty",
.out_name = "libghostty-x86_64-fat.a", .out_name = "libghostty-x86_64-fat.a",
@ -530,7 +530,7 @@ pub fn build(b: *std.Build) !void {
_ = try addDeps(b, wasm, true); _ = try addDeps(b, wasm, true);
// Install // Install
const wasm_install = b.addInstallArtifact(wasm); const wasm_install = b.addInstallArtifact(wasm, .{});
wasm_install.dest_dir = .{ .prefix = {} }; wasm_install.dest_dir = .{ .prefix = {} };
const step = b.step("wasm", "Build the wasm library"); const step = b.step("wasm", "Build the wasm library");
@ -684,11 +684,11 @@ fn addDeps(
// stb_image_resize // stb_image_resize
const stb_image_resize_step = try stb_image_resize.link(b, step, .{}); const stb_image_resize_step = try stb_image_resize.link(b, step, .{});
try static_libs.append(.{ .generated = &stb_image_resize_step.output_path_source }); try static_libs.append(stb_image_resize_step.getEmittedBin());
// utf8proc // utf8proc
const utf8proc_step = try utf8proc.link(b, step); const utf8proc_step = try utf8proc.link(b, step);
try static_libs.append(.{ .generated = &utf8proc_step.output_path_source }); try static_libs.append(utf8proc_step.getEmittedBin());
// Imgui, we have to do this later since we need some information // Imgui, we have to do this later since we need some information
const imgui_backends = if (step.target.isDarwin()) const imgui_backends = if (step.target.isDarwin())
@ -702,7 +702,7 @@ fn addDeps(
// Dynamic link // Dynamic link
if (!static) { if (!static) {
step.addIncludePath(freetype.include_path_self); step.addIncludePath(.{ .path = freetype.include_path_self });
step.linkSystemLibrary("bzip2"); step.linkSystemLibrary("bzip2");
step.linkSystemLibrary("freetype2"); step.linkSystemLibrary("freetype2");
step.linkSystemLibrary("harfbuzz"); step.linkSystemLibrary("harfbuzz");
@ -716,7 +716,7 @@ fn addDeps(
// Other dependencies, we may dynamically link // Other dependencies, we may dynamically link
if (static) { if (static) {
const zlib_step = try zlib.link(b, step); const zlib_step = try zlib.link(b, step);
try static_libs.append(.{ .generated = &zlib_step.output_path_source }); try static_libs.append(zlib_step.getEmittedBin());
const libpng_step = try libpng.link(b, step, .{ const libpng_step = try libpng.link(b, step, .{
.zlib = .{ .zlib = .{
@ -724,7 +724,7 @@ fn addDeps(
.include = &zlib.include_paths, .include = &zlib.include_paths,
}, },
}); });
try static_libs.append(.{ .generated = &libpng_step.output_path_source }); try static_libs.append(libpng_step.getEmittedBin());
// Freetype // Freetype
const freetype_step = try freetype.link(b, step, .{ const freetype_step = try freetype.link(b, step, .{
@ -740,7 +740,7 @@ fn addDeps(
.include = &zlib.include_paths, .include = &zlib.include_paths,
}, },
}); });
try static_libs.append(.{ .generated = &freetype_step.output_path_source }); try static_libs.append(freetype_step.getEmittedBin());
// Harfbuzz // Harfbuzz
const harfbuzz_step = try harfbuzz.link(b, step, .{ const harfbuzz_step = try harfbuzz.link(b, step, .{
@ -755,11 +755,11 @@ fn addDeps(
}, },
}); });
system_sdk.include(b, harfbuzz_step, .{}); system_sdk.include(b, harfbuzz_step, .{});
try static_libs.append(.{ .generated = &harfbuzz_step.output_path_source }); try static_libs.append(harfbuzz_step.getEmittedBin());
// Pixman // Pixman
const pixman_step = try pixman.link(b, step, .{}); const pixman_step = try pixman.link(b, step, .{});
try static_libs.append(.{ .generated = &pixman_step.output_path_source }); try static_libs.append(pixman_step.getEmittedBin());
// Only Linux gets fontconfig // Only Linux gets fontconfig
if (font_backend.hasFontconfig()) { if (font_backend.hasFontconfig()) {
@ -792,16 +792,19 @@ fn addDeps(
if (!lib) { if (!lib) {
// We always statically compile glad // We always statically compile glad
step.addIncludePath("vendor/glad/include/"); step.addIncludePath(.{ .path = "vendor/glad/include/" });
step.addCSourceFile("vendor/glad/src/gl.c", &.{}); step.addCSourceFile(.{
.file = .{ .path = "vendor/glad/src/gl.c" },
.flags = &.{},
});
// When we're targeting flatpak we ALWAYS link GTK so we // When we're targeting flatpak we ALWAYS link GTK so we
// get access to glib for dbus. // get access to glib for dbus.
if (flatpak) { if (flatpak) {
step.linkSystemLibrary("gtk4"); step.linkSystemLibrary("gtk4");
switch (step.target.getCpuArch()) { switch (step.target.getCpuArch()) {
.aarch64 => step.addLibraryPath("/usr/lib/aarch64-linux-gnu"), .aarch64 => step.addLibraryPath(.{ .path = "/usr/lib/aarch64-linux-gnu" }),
.x86_64 => step.addLibraryPath("/usr/lib/x86_64-linux-gnu"), .x86_64 => step.addLibraryPath(.{ .path = "/usr/lib/x86_64-linux-gnu" }),
else => @panic("unsupported flatpak target"), else => @panic("unsupported flatpak target"),
} }
} }
@ -874,8 +877,8 @@ fn benchSteps(
.root_source_file = .{ .path = path }, .root_source_file = .{ .path = path },
.target = target, .target = target,
.optimize = optimize, .optimize = optimize,
.main_pkg_path = .{ .path = "./src" },
}); });
c_exe.setMainPkgPath("./src");
if (install) b.installArtifact(c_exe); if (install) b.installArtifact(c_exe);
_ = try addDeps(b, c_exe, true); _ = try addDeps(b, c_exe, true);
} }
@ -915,7 +918,7 @@ fn conformanceSteps(
.optimize = optimize, .optimize = optimize,
}); });
const install = b.addInstallArtifact(c_exe); const install = b.addInstallArtifact(c_exe, .{});
install.dest_sub_path = "conformance"; install.dest_sub_path = "conformance";
b.getInstallStep().dependOn(&install.step); b.getInstallStep().dependOn(&install.step);

View File

@ -33,13 +33,13 @@ modules:
- cp -r ./* /app/tmp/zig - cp -r ./* /app/tmp/zig
sources: sources:
- type: archive - type: archive
url: https://ziglang.org/builds/zig-linux-x86_64-0.11.0-dev.4282+0f21d3d4d.tar.xz url: https://ziglang.org/builds/zig-linux-x86_64-0.11.0-dev.4404+4f6013bf5.tar.xz
sha256: 7668c82735abbb1bbe51b06aaf4114962983e8eed1a217f03482b2399b54c32a sha256: 997f7d9747e3d46c31b3d6e54e4263810c67c8f1a77a8d9e4279af8535b39f84
only-arches: only-arches:
- x86_64 - x86_64
- type: archive - type: archive
url: https://ziglang.org/builds/zig-linux-aarch64-0.11.0-dev.4282+0f21d3d4d.tar.xz url: https://ziglang.org/builds/zig-linux-aarch64-0.11.0-dev.4404+4f6013bf5.tar.xz
sha256: 43b7c5a1462750f732e2f1e08ab1123c95abf9e3df6c516de83cc9b9069421cf sha256: 918d57fe5862380bca2c56add0542ed03eb1dd6ed8e3021a287cad78ffbd6d72
only-arches: only-arches:
- aarch64 - aarch64

6
flake.lock generated
View File

@ -126,11 +126,11 @@
"nixpkgs": "nixpkgs_2" "nixpkgs": "nixpkgs_2"
}, },
"locked": { "locked": {
"lastModified": 1690503794, "lastModified": 1690978078,
"narHash": "sha256-KeJI6b2CxOFeCzp8wWJCdct5XSgUKpsDap0rkWttVXc=", "narHash": "sha256-+S9s6sjOGuGCtA9njTdduJ7KjZm2tskxKhwGRKBK/xM=",
"owner": "mitchellh", "owner": "mitchellh",
"repo": "zig-overlay", "repo": "zig-overlay",
"rev": "cdf67ad78726cd7919984efbb83924ea47b4c0f1", "rev": "c9f51464f2c2c9c75f3d7fdc58c157d252545dec",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@ -44,8 +44,8 @@ pub fn link(
) !*std.build.LibExeObjStep { ) !*std.build.LibExeObjStep {
const lib = try buildFontconfig(b, step, opt); const lib = try buildFontconfig(b, step, opt);
step.linkLibrary(lib); step.linkLibrary(lib);
step.addIncludePath(include_path); step.addIncludePath(.{ .path = include_path });
step.addIncludePath(include_path_self); step.addIncludePath(.{ .path = include_path_self });
return lib; return lib;
} }
@ -62,8 +62,8 @@ pub fn buildFontconfig(
}); });
// Include // Include
lib.addIncludePath(include_path); lib.addIncludePath(.{ .path = include_path });
lib.addIncludePath(include_path_self); lib.addIncludePath(.{ .path = include_path_self });
// Link // Link
lib.linkLibC(); lib.linkLibC();
@ -74,7 +74,7 @@ pub fn buildFontconfig(
lib.linkSystemLibrary("expat"); lib.linkSystemLibrary("expat");
if (opt.expat.include) |dirs| if (opt.expat.include) |dirs|
for (dirs) |dir| lib.addIncludePath(dir); for (dirs) |dir| lib.addIncludePath(.{ .path = dir });
} }
if (opt.freetype.enabled) { if (opt.freetype.enabled) {
if (opt.freetype.step) |freetype| if (opt.freetype.step) |freetype|
@ -83,7 +83,7 @@ pub fn buildFontconfig(
lib.linkSystemLibrary("freetype2"); lib.linkSystemLibrary("freetype2");
if (opt.freetype.include) |dirs| if (opt.freetype.include) |dirs|
for (dirs) |dir| lib.addIncludePath(dir); for (dirs) |dir| lib.addIncludePath(.{ .path = dir });
} }
if (!target.isWindows()) { if (!target.isWindows()) {
lib.linkSystemLibrary("pthread"); lib.linkSystemLibrary("pthread");

View File

@ -41,8 +41,8 @@ pub fn link(
) !*std.build.LibExeObjStep { ) !*std.build.LibExeObjStep {
const lib = try buildFreetype(b, step, opt); const lib = try buildFreetype(b, step, opt);
step.linkLibrary(lib); step.linkLibrary(lib);
step.addIncludePath(include_path); step.addIncludePath(.{ .path = include_path });
step.addIncludePath(include_path_self); step.addIncludePath(.{ .path = include_path_self });
return lib; return lib;
} }
@ -59,7 +59,7 @@ pub fn buildFreetype(
}); });
// Include // Include
lib.addIncludePath(include_path); lib.addIncludePath(.{ .path = include_path });
// Link // Link
lib.linkLibC(); lib.linkLibC();
@ -70,7 +70,7 @@ pub fn buildFreetype(
lib.linkSystemLibrary("libpng"); lib.linkSystemLibrary("libpng");
if (opt.libpng.include) |dirs| if (opt.libpng.include) |dirs|
for (dirs) |dir| lib.addIncludePath(dir); for (dirs) |dir| lib.addIncludePath(.{ .path = dir });
} }
if (opt.zlib.enabled) { if (opt.zlib.enabled) {
if (opt.zlib.step) |zlib| if (opt.zlib.step) |zlib|
@ -79,7 +79,7 @@ pub fn buildFreetype(
lib.linkSystemLibrary("z"); lib.linkSystemLibrary("z");
if (opt.zlib.include) |dirs| if (opt.zlib.include) |dirs|
for (dirs) |dir| lib.addIncludePath(dir); for (dirs) |dir| lib.addIncludePath(.{ .path = dir });
} }
// Compile // Compile
@ -100,16 +100,30 @@ pub fn buildFreetype(
// C files // C files
lib.addCSourceFiles(srcs, flags.items); lib.addCSourceFiles(srcs, flags.items);
switch (target.getOsTag()) { switch (target.getOsTag()) {
.linux => lib.addCSourceFile(root ++ "builds/unix/ftsystem.c", flags.items), .linux => lib.addCSourceFile(.{
.windows => lib.addCSourceFile(root ++ "builds/windows/ftsystem.c", flags.items), .file = .{ .path = root ++ "builds/unix/ftsystem.c" },
else => lib.addCSourceFile(root ++ "src/base/ftsystem.c", flags.items), .flags = flags.items,
}),
.windows => lib.addCSourceFile(.{
.file = .{ .path = root ++ "builds/windows/ftsystem.c" },
.flags = flags.items,
}),
else => lib.addCSourceFile(.{
.file = .{ .path = root ++ "src/base/ftsystem.c" },
.flags = flags.items,
}),
} }
switch (target.getOsTag()) { switch (target.getOsTag()) {
.windows => { .windows => {
lib.addCSourceFile(root ++ "builds/windows/ftdebug.c", flags.items); lib.addCSourceFiles(&.{
lib.addCSourceFile(root ++ "src/base/ftver.c", flags.items); root ++ "builds/windows/ftdebug.c",
root ++ "src/base/ftver.c",
}, flags.items);
}, },
else => lib.addCSourceFile(root ++ "src/base/ftdebug.c", flags.items), else => lib.addCSourceFile(.{
.file = .{ .path = root ++ "src/base/ftdebug.c" },
.flags = flags.items,
}),
} }
return lib; return lib;

View File

@ -45,7 +45,7 @@ pub fn link(
) !*std.build.LibExeObjStep { ) !*std.build.LibExeObjStep {
const lib = try buildHarfbuzz(b, step, opt); const lib = try buildHarfbuzz(b, step, opt);
step.linkLibrary(lib); step.linkLibrary(lib);
step.addIncludePath(include_path); step.addIncludePath(.{ .path = include_path });
return lib; return lib;
} }
@ -61,7 +61,7 @@ pub fn buildHarfbuzz(
}); });
// Include // Include
lib.addIncludePath(include_path); lib.addIncludePath(.{ .path = include_path });
// Link // Link
lib.linkLibC(); lib.linkLibC();
@ -73,7 +73,7 @@ pub fn buildHarfbuzz(
lib.linkSystemLibrary("freetype2"); lib.linkSystemLibrary("freetype2");
if (opt.freetype.include) |dirs| if (opt.freetype.include) |dirs|
for (dirs) |dir| lib.addIncludePath(dir); for (dirs) |dir| lib.addIncludePath(.{ .path = dir });
} }
// Compile // Compile

View File

@ -37,7 +37,7 @@ pub fn link(
) !*std.build.LibExeObjStep { ) !*std.build.LibExeObjStep {
const lib = try buildImgui(b, step, opt); const lib = try buildImgui(b, step, opt);
step.linkLibrary(lib); step.linkLibrary(lib);
inline for (include_paths) |path| step.addIncludePath(path); inline for (include_paths) |path| step.addIncludePath(.{ .path = path });
return lib; return lib;
} }
@ -54,7 +54,7 @@ pub fn buildImgui(
}); });
// Include // Include
inline for (include_paths) |path| lib.addIncludePath(path); inline for (include_paths) |path| lib.addIncludePath(.{ .path = path });
// Link // Link
lib.linkLibC(); lib.linkLibC();
@ -88,7 +88,7 @@ pub fn buildImgui(
lib.linkSystemLibrary("freetype2"); lib.linkSystemLibrary("freetype2");
if (opt.freetype.include) |dirs| if (opt.freetype.include) |dirs|
for (dirs) |dir| lib.addIncludePath(dir); for (dirs) |dir| lib.addIncludePath(.{ .path = dir });
// Enable in defines // Enable in defines
try flags.appendSlice(&.{ try flags.appendSlice(&.{
@ -97,7 +97,10 @@ pub fn buildImgui(
}); });
// Add necessary C file // Add necessary C file
lib.addCSourceFile(root ++ "imgui/misc/freetype/imgui_freetype.cpp", flags.items); lib.addCSourceFile(.{
.file = .{ .path = root ++ "imgui/misc/freetype/imgui_freetype.cpp" },
.flags = flags.items,
});
} }
// C files // C files
@ -117,7 +120,10 @@ pub fn buildImgui(
.{ root, backend, ext }, .{ root, backend, ext },
); );
lib.addCSourceFile(path, flags.items); lib.addCSourceFile(.{
.file = .{ .path = path },
.flags = flags.items,
});
} }
} }

View File

@ -32,7 +32,7 @@ pub fn link(
) !*std.build.LibExeObjStep { ) !*std.build.LibExeObjStep {
const lib = try buildLib(b, step, opt); const lib = try buildLib(b, step, opt);
step.linkLibrary(lib); step.linkLibrary(lib);
step.addIncludePath(include_path); step.addIncludePath(.{ .path = include_path });
return lib; return lib;
} }
@ -49,8 +49,8 @@ pub fn buildLib(
}); });
// Include // Include
lib.addIncludePath(include_path); lib.addIncludePath(.{ .path = include_path });
lib.addIncludePath(include_path_pnglibconf); lib.addIncludePath(.{ .path = include_path_pnglibconf });
// Link // Link
lib.linkLibC(); lib.linkLibC();
@ -64,7 +64,7 @@ pub fn buildLib(
lib.linkSystemLibrary("z"); lib.linkSystemLibrary("z");
if (opt.zlib.include) |dirs| if (opt.zlib.include) |dirs|
for (dirs) |dir| lib.addIncludePath(dir); for (dirs) |dir| lib.addIncludePath(.{ .path = dir });
// Compile // Compile
var flags = std.ArrayList([]const u8).init(b.allocator); var flags = std.ArrayList([]const u8).init(b.allocator);

View File

@ -27,8 +27,14 @@ pub fn link(
.target = step.target, .target = step.target,
.optimize = step.optimize, .optimize = step.optimize,
}); });
step.addCSourceFile(comptime thisDir() ++ "/os/log.c", flags.items); step.addCSourceFile(.{
step.addCSourceFile(comptime thisDir() ++ "/text/ext.c", flags.items); .file = .{ .path = comptime thisDir() ++ "/os/log.c" },
.flags = flags.items,
});
step.addCSourceFile(.{
.file = .{ .path = comptime thisDir() ++ "/text/ext.c" },
.flags = flags.items,
});
step.linkFramework("CoreFoundation"); step.linkFramework("CoreFoundation");
step.linkFramework("CoreText"); step.linkFramework("CoreText");
return lib; return lib;

View File

@ -42,8 +42,8 @@ pub fn link(
) !*std.build.LibExeObjStep { ) !*std.build.LibExeObjStep {
const lib = try buildPixman(b, step, opt); const lib = try buildPixman(b, step, opt);
step.linkLibrary(lib); step.linkLibrary(lib);
step.addIncludePath(include_path); step.addIncludePath(.{ .path = include_path });
step.addIncludePath(include_path_self); step.addIncludePath(.{ .path = include_path_self });
return lib; return lib;
} }
@ -62,8 +62,8 @@ pub fn buildPixman(
}); });
// Include // Include
lib.addIncludePath(include_path); lib.addIncludePath(.{ .path = include_path });
lib.addIncludePath(include_path_self); lib.addIncludePath(.{ .path = include_path_self });
// Link // Link
lib.linkLibC(); lib.linkLibC();

View File

@ -25,7 +25,7 @@ pub fn link(
) !*std.build.LibExeObjStep { ) !*std.build.LibExeObjStep {
const lib = try buildStbImageResize(b, step, opt); const lib = try buildStbImageResize(b, step, opt);
step.linkLibrary(lib); step.linkLibrary(lib);
inline for (include_paths) |path| step.addIncludePath(path); inline for (include_paths) |path| step.addIncludePath(.{ .path = path });
return lib; return lib;
} }
@ -43,7 +43,7 @@ pub fn buildStbImageResize(
}); });
// Include // Include
inline for (include_paths) |path| lib.addIncludePath(path); inline for (include_paths) |path| lib.addIncludePath(.{ .path = path });
// Link // Link
lib.linkLibC(); lib.linkLibC();
@ -56,7 +56,10 @@ pub fn buildStbImageResize(
}); });
// C files // C files
lib.addCSourceFile(root ++ "/stb_image_resize.c", flags.items); lib.addCSourceFile(.{
.file = .{ .path = root ++ "/stb_image_resize.c" },
.flags = flags.items,
});
return lib; return lib;
} }

View File

@ -16,7 +16,7 @@ fn thisDir() []const u8 {
pub fn link(b: *std.Build, step: *std.build.LibExeObjStep) !*std.build.LibExeObjStep { pub fn link(b: *std.Build, step: *std.build.LibExeObjStep) !*std.build.LibExeObjStep {
const tracy = try buildTracy(b, step); const tracy = try buildTracy(b, step);
step.linkLibrary(tracy); step.linkLibrary(tracy);
step.addIncludePath(root); step.addIncludePath(.{ .path = root });
return tracy; return tracy;
} }
@ -45,11 +45,14 @@ pub fn buildTracy(
}); });
} }
lib.addIncludePath(root); lib.addIncludePath(.{ .path = root });
lib.addCSourceFile(try std.fs.path.join( lib.addCSourceFile(.{
b.allocator, .file = .{ .path = try std.fs.path.join(
&.{ root, "TracyClient.cpp" }, b.allocator,
), flags.items); &.{ root, "TracyClient.cpp" },
) },
.flags = flags.items,
});
lib.linkLibC(); lib.linkLibC();
lib.linkSystemLibrary("c++"); lib.linkSystemLibrary("c++");

View File

@ -19,7 +19,7 @@ fn thisDir() []const u8 {
pub fn link(b: *std.Build, step: *std.build.LibExeObjStep) !*std.build.LibExeObjStep { pub fn link(b: *std.Build, step: *std.build.LibExeObjStep) !*std.build.LibExeObjStep {
const lib = try buildLib(b, step); const lib = try buildLib(b, step);
step.linkLibrary(lib); step.linkLibrary(lib);
step.addIncludePath(include_path); step.addIncludePath(.{ .path = include_path });
return lib; return lib;
} }
@ -34,7 +34,7 @@ pub fn buildLib(
}); });
// Include // Include
lib.addIncludePath(include_path); lib.addIncludePath(.{ .path = include_path });
// Link // Link
lib.linkLibC(); lib.linkLibC();

View File

@ -18,7 +18,7 @@ fn thisDir() []const u8 {
pub fn link(b: *std.build.Builder, step: *std.build.LibExeObjStep) !*std.build.LibExeObjStep { pub fn link(b: *std.build.Builder, step: *std.build.LibExeObjStep) !*std.build.LibExeObjStep {
const lib = try buildLib(b, step); const lib = try buildLib(b, step);
step.linkLibrary(lib); step.linkLibrary(lib);
step.addIncludePath(include_path); step.addIncludePath(.{ .path = include_path });
return lib; return lib;
} }
@ -33,7 +33,7 @@ pub fn buildLib(
}); });
// Include // Include
lib.addIncludePath(include_path); lib.addIncludePath(.{ .path = include_path });
// Link // Link
lib.linkLibC(); lib.linkLibC();

2
vendor/mach-glfw vendored

@ -1 +1 @@
Subproject commit 70ff87ba8af0820bbcfdbdf3b15555cb4c19f7ab Subproject commit 037ccd1a241cf71d6e777ef5fff1b1241cf652e0

2
vendor/zig-libxml2 vendored

@ -1 +1 @@
Subproject commit 252c732429a686e4a835831038263a554e752c40 Subproject commit 5aae6093c9faa8699d4a39b530b44daf5df91c0e