all: build: update to zig version 0.11.0-dev.6883+da0509750
This commit is contained in:
parent
624ab118db
commit
edd2117174
9 changed files with 24 additions and 29 deletions
|
|
@ -10,7 +10,8 @@ const earcut = @import("libs/earcut/build.zig");
|
||||||
const gamemode = @import("libs/gamemode/build.zig");
|
const gamemode = @import("libs/gamemode/build.zig");
|
||||||
const model3d = @import("libs/model3d/build.zig");
|
const model3d = @import("libs/model3d/build.zig");
|
||||||
const dusk = @import("libs/dusk/build.zig");
|
const dusk = @import("libs/dusk/build.zig");
|
||||||
const wasmserve = @import("tools/wasmserve/wasmserve.zig");
|
// TODO: get wasmserve working
|
||||||
|
// const wasmserve = @import("tools/wasmserve/wasmserve.zig");
|
||||||
pub const gpu_dawn = @import("libs/gpu-dawn/sdk.zig").Sdk(.{
|
pub const gpu_dawn = @import("libs/gpu-dawn/sdk.zig").Sdk(.{
|
||||||
.glfw_include_dir = sdkPath("/libs/glfw/upstream/glfw/include"),
|
.glfw_include_dir = sdkPath("/libs/glfw/upstream/glfw/include"),
|
||||||
.system_sdk = system_sdk,
|
.system_sdk = system_sdk,
|
||||||
|
|
@ -27,7 +28,8 @@ const core = @import("libs/core/sdk.zig").Sdk(.{
|
||||||
.gpu_dawn = gpu_dawn,
|
.gpu_dawn = gpu_dawn,
|
||||||
.glfw = glfw,
|
.glfw = glfw,
|
||||||
.gamemode = gamemode,
|
.gamemode = gamemode,
|
||||||
.wasmserve = wasmserve,
|
// TODO: get wasmserve working
|
||||||
|
// .wasmserve = wasmserve,
|
||||||
.sysjs = sysjs,
|
.sysjs = sysjs,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -120,7 +122,6 @@ pub fn build(b: *std.Build) !void {
|
||||||
fn testStep(b: *std.Build, optimize: std.builtin.OptimizeMode, target: std.zig.CrossTarget) *std.build.RunStep {
|
fn testStep(b: *std.Build, optimize: std.builtin.OptimizeMode, target: std.zig.CrossTarget) *std.build.RunStep {
|
||||||
const main_tests = b.addTest(.{
|
const main_tests = b.addTest(.{
|
||||||
.name = "mach-tests",
|
.name = "mach-tests",
|
||||||
.kind = .test_exe,
|
|
||||||
.root_source_file = .{ .path = "src/main.zig" },
|
.root_source_file = .{ .path = "src/main.zig" },
|
||||||
.target = target,
|
.target = target,
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,6 @@ pub fn build(b: *Build) void {
|
||||||
pub fn testStep(b: *Build, optimize: std.builtin.OptimizeMode, target: std.zig.CrossTarget) *std.build.RunStep {
|
pub fn testStep(b: *Build, optimize: std.builtin.OptimizeMode, target: std.zig.CrossTarget) *std.build.RunStep {
|
||||||
const main_tests = b.addTest(.{
|
const main_tests = b.addTest(.{
|
||||||
.name = "basisu-tests",
|
.name = "basisu-tests",
|
||||||
.kind = .test_exe,
|
|
||||||
.root_source_file = .{ .path = sdkPath("/src/main.zig") },
|
.root_source_file = .{ .path = sdkPath("/src/main.zig") },
|
||||||
.target = target,
|
.target = target,
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,6 @@ pub fn Sdk(comptime deps: anytype) type {
|
||||||
pub fn testStep(b: *std.Build, optimize: std.builtin.OptimizeMode, target: std.zig.CrossTarget) !*std.build.RunStep {
|
pub fn testStep(b: *std.Build, optimize: std.builtin.OptimizeMode, target: std.zig.CrossTarget) !*std.build.RunStep {
|
||||||
const main_tests = b.addTest(.{
|
const main_tests = b.addTest(.{
|
||||||
.name = "core-tests",
|
.name = "core-tests",
|
||||||
.kind = .test_exe,
|
|
||||||
.root_source_file = .{ .path = sdkPath("/src/main.zig") },
|
.root_source_file = .{ .path = sdkPath("/src/main.zig") },
|
||||||
.target = target,
|
.target = target,
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
|
|
@ -92,7 +91,7 @@ pub fn Sdk(comptime deps: anytype) type {
|
||||||
pub const LinkError = deps.glfw.LinkError;
|
pub const LinkError = deps.glfw.LinkError;
|
||||||
pub const RunError = error{
|
pub const RunError = error{
|
||||||
ParsingIpFailed,
|
ParsingIpFailed,
|
||||||
} || deps.wasmserve.Error || std.fmt.ParseIntError;
|
} || std.fmt.ParseIntError;
|
||||||
|
|
||||||
pub const Platform = enum {
|
pub const Platform = enum {
|
||||||
native,
|
native,
|
||||||
|
|
@ -219,18 +218,20 @@ pub fn Sdk(comptime deps: anytype) type {
|
||||||
|
|
||||||
pub fn run(app: *const App) RunError!*std.build.Step {
|
pub fn run(app: *const App) RunError!*std.build.Step {
|
||||||
if (app.platform == .web) {
|
if (app.platform == .web) {
|
||||||
const address = std.process.getEnvVarOwned(app.b.allocator, "MACH_ADDRESS") catch try app.b.allocator.dupe(u8, "127.0.0.1");
|
@panic("TODO: wasmserve is broken! sorry");
|
||||||
const port = std.process.getEnvVarOwned(app.b.allocator, "MACH_PORT") catch try app.b.allocator.dupe(u8, "8080");
|
// TODO: get wasmserve working
|
||||||
const address_parsed = std.net.Address.parseIp4(address, try std.fmt.parseInt(u16, port, 10)) catch return error.ParsingIpFailed;
|
// const address = std.process.getEnvVarOwned(app.b.allocator, "MACH_ADDRESS") catch try app.b.allocator.dupe(u8, "127.0.0.1");
|
||||||
const serve_step = try deps.wasmserve.serve(
|
// const port = std.process.getEnvVarOwned(app.b.allocator, "MACH_PORT") catch try app.b.allocator.dupe(u8, "8080");
|
||||||
app.step,
|
// const address_parsed = std.net.Address.parseIp4(address, try std.fmt.parseInt(u16, port, 10)) catch return error.ParsingIpFailed;
|
||||||
.{
|
// const serve_step = try deps.wasmserve.serve(
|
||||||
.install_dir = web_install_dir,
|
// app.step,
|
||||||
.watch_paths = app.watch_paths,
|
// .{
|
||||||
.listen_address = address_parsed,
|
// .install_dir = web_install_dir,
|
||||||
},
|
// .watch_paths = app.watch_paths,
|
||||||
);
|
// .listen_address = address_parsed,
|
||||||
return &serve_step.step;
|
// },
|
||||||
|
// );
|
||||||
|
// return &serve_step.step;
|
||||||
} else {
|
} else {
|
||||||
return &app.step.run().step;
|
return &app.step.run().step;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@ pub fn module(b: *std.Build) *std.build.Module {
|
||||||
pub fn testStep(b: *std.Build, optimize: std.builtin.OptimizeMode, target: std.zig.CrossTarget) *std.build.RunStep {
|
pub fn testStep(b: *std.Build, optimize: std.builtin.OptimizeMode, target: std.zig.CrossTarget) *std.build.RunStep {
|
||||||
const main_tests = b.addTest(.{
|
const main_tests = b.addTest(.{
|
||||||
.name = "dusk-tests",
|
.name = "dusk-tests",
|
||||||
.kind = .test_exe,
|
|
||||||
.root_source_file = .{ .path = sdkPath("/test/main.zig") },
|
.root_source_file = .{ .path = sdkPath("/test/main.zig") },
|
||||||
.target = target,
|
.target = target,
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,6 @@ pub fn build(b: *std.Build) void {
|
||||||
pub fn testStep(b: *std.Build, optimize: std.builtin.OptimizeMode, target: std.zig.CrossTarget) *std.build.RunStep {
|
pub fn testStep(b: *std.Build, optimize: std.builtin.OptimizeMode, target: std.zig.CrossTarget) *std.build.RunStep {
|
||||||
const main_tests = b.addTest(.{
|
const main_tests = b.addTest(.{
|
||||||
.name = "ecs-tests",
|
.name = "ecs-tests",
|
||||||
.kind = .test_exe,
|
|
||||||
.root_source_file = .{ .path = sdkPath("/src/main.zig") },
|
.root_source_file = .{ .path = sdkPath("/src/main.zig") },
|
||||||
.target = target,
|
.target = target,
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,6 @@ pub fn build(b: *std.Build) !void {
|
||||||
pub fn testStep(b: *Build, optimize: std.builtin.OptimizeMode, target: std.zig.CrossTarget) *std.build.RunStep {
|
pub fn testStep(b: *Build, optimize: std.builtin.OptimizeMode, target: std.zig.CrossTarget) *std.build.RunStep {
|
||||||
const main_tests = b.addTest(.{
|
const main_tests = b.addTest(.{
|
||||||
.name = "freetype-tests",
|
.name = "freetype-tests",
|
||||||
.kind = .test_exe,
|
|
||||||
.root_source_file = .{ .path = sdkPath("/src/main.zig") },
|
.root_source_file = .{ .path = sdkPath("/src/main.zig") },
|
||||||
.target = target,
|
.target = target,
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
|
|
@ -104,7 +103,6 @@ pub fn testStep(b: *Build, optimize: std.builtin.OptimizeMode, target: std.zig.C
|
||||||
|
|
||||||
const harfbuzz_tests = b.addTest(.{
|
const harfbuzz_tests = b.addTest(.{
|
||||||
.name = "harfbuzz-tests",
|
.name = "harfbuzz-tests",
|
||||||
.kind = .test_exe,
|
|
||||||
.root_source_file = .{ .path = sdkPath("/src/harfbuzz/main.zig") },
|
.root_source_file = .{ .path = sdkPath("/src/harfbuzz/main.zig") },
|
||||||
.target = target,
|
.target = target,
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,6 @@ pub fn build(b: *std.Build) void {
|
||||||
pub fn testStep(b: *std.Build, optimize: std.builtin.OptimizeMode, target: std.zig.CrossTarget) *std.build.RunStep {
|
pub fn testStep(b: *std.Build, optimize: std.builtin.OptimizeMode, target: std.zig.CrossTarget) *std.build.RunStep {
|
||||||
const main_tests = b.addTest(.{
|
const main_tests = b.addTest(.{
|
||||||
.name = "model3d-tests",
|
.name = "model3d-tests",
|
||||||
.kind = .test_exe,
|
|
||||||
.root_source_file = .{ .path = sdkPath("/src/main.zig") },
|
.root_source_file = .{ .path = sdkPath("/src/main.zig") },
|
||||||
.target = target,
|
.target = target,
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,6 @@ pub fn Sdk(comptime deps: anytype) type {
|
||||||
pub fn testStep(b: *std.Build, optimize: std.builtin.OptimizeMode, target: std.zig.CrossTarget) *std.build.RunStep {
|
pub fn testStep(b: *std.Build, optimize: std.builtin.OptimizeMode, target: std.zig.CrossTarget) *std.build.RunStep {
|
||||||
const main_tests = b.addTest(.{
|
const main_tests = b.addTest(.{
|
||||||
.name = "sysaudio-tests",
|
.name = "sysaudio-tests",
|
||||||
.kind = .test_exe,
|
|
||||||
.root_source_file = .{ .path = sdkPath("/src/main.zig") },
|
.root_source_file = .{ .path = sdkPath("/src/main.zig") },
|
||||||
.target = target,
|
.target = target,
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
|
|
|
||||||
|
|
@ -27,20 +27,20 @@ pub const Options = struct {
|
||||||
pub const Error = error{CannotOpenDirectory} || mem.Allocator.Error;
|
pub const Error = error{CannotOpenDirectory} || mem.Allocator.Error;
|
||||||
|
|
||||||
pub fn serve(step: *build.CompileStep, options: Options) Error!*Wasmserve {
|
pub fn serve(step: *build.CompileStep, options: Options) Error!*Wasmserve {
|
||||||
const self = try step.builder.allocator.create(Wasmserve);
|
const self = try step.step.owner.allocator.create(Wasmserve);
|
||||||
const install_dir = options.install_dir orelse build.InstallDir{ .lib = {} };
|
const install_dir = options.install_dir orelse build.InstallDir{ .lib = {} };
|
||||||
const install_dir_iter = fs.cwd().makeOpenPathIterable(step.builder.getInstallPath(install_dir, ""), .{}) catch
|
const install_dir_iter = fs.cwd().makeOpenPathIterable(step.step.owner.getInstallPath(install_dir, ""), .{}) catch
|
||||||
return error.CannotOpenDirectory;
|
return error.CannotOpenDirectory;
|
||||||
self.* = Wasmserve{
|
self.* = Wasmserve{
|
||||||
.step = build.Step.init(.run, "wasmserve", step.builder.allocator, Wasmserve.make),
|
.step = build.Step.init(.run, "wasmserve", step.step.owner.allocator, Wasmserve.make),
|
||||||
.b = step.builder,
|
.b = step.step.owner,
|
||||||
.exe_step = step,
|
.exe_step = step,
|
||||||
.install_dir = install_dir,
|
.install_dir = install_dir,
|
||||||
.install_dir_iter = install_dir_iter,
|
.install_dir_iter = install_dir_iter,
|
||||||
.address = options.listen_address orelse net.Address.initIp4([4]u8{ 127, 0, 0, 1 }, 8080),
|
.address = options.listen_address orelse net.Address.initIp4([4]u8{ 127, 0, 0, 1 }, 8080),
|
||||||
.subscriber = null,
|
.subscriber = null,
|
||||||
.watch_paths = options.watch_paths orelse &.{step.root_src.?.path},
|
.watch_paths = options.watch_paths orelse &.{step.root_src.?.path},
|
||||||
.mtimes = std.AutoHashMap(fs.File.INode, i128).init(step.builder.allocator),
|
.mtimes = std.AutoHashMap(fs.File.INode, i128).init(step.step.owner.allocator),
|
||||||
.notify_msg = null,
|
.notify_msg = null,
|
||||||
};
|
};
|
||||||
return self;
|
return self;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue