mirror of
https://mzte.de/git/LordMZTE/dotfiles.git
synced 2024-12-13 11:42:57 +01:00
scripts finally build on latest zig!
This commit is contained in:
parent
6aa0ceeae7
commit
9ef14a1650
7 changed files with 19 additions and 40 deletions
4
justfile
4
justfile
|
@ -22,8 +22,8 @@ install-scripts target=(`echo $HOME` + "/.local"):
|
|||
cd scripts/vinput && zig build -Doptimize=ReleaseFast -p {{target}}
|
||||
cd scripts/playtwitch && zig build -Doptimize=ReleaseFast -p {{target}}
|
||||
cd scripts/openbrowser && zig build -Doptimize=ReleaseFast -p {{target}}
|
||||
cd scripts/prompt && gyro build -Doptimize=ReleaseFast -p {{target}}
|
||||
cd scripts/mzteinit && gyro build -Doptimize=ReleaseFast -p {{target}}
|
||||
cd scripts/prompt && zig build -Doptimize=ReleaseFast -p {{target}}
|
||||
cd scripts/mzteinit && zig build -Doptimize=ReleaseFast -p {{target}}
|
||||
|
||||
install-lsps-paru:
|
||||
#!/bin/sh
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
|
||||
.dependencies = .{
|
||||
.ansi_term = .{
|
||||
.url = "https://github.com/ziglibs/ansi-term/archive/3238ee3600775a0d2ed52fa5bf30669daebd47cd.tar.gz",
|
||||
.hash = "122054a0aadb65c0b51e0d2b6083272c8ccd59abe83469425c3ea03030e450df4625",
|
||||
.url = "https://github.com/ziglibs/ansi-term/archive/84b2a92970bc3328b1366abb3bffd677bd681669.tar.gz",
|
||||
.hash = "1220d454469ddc251e46fff3b2b11f7016deb54bc5cd8618e809a09a4b1f5304f555",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,19 +1,16 @@
|
|||
const std = @import("std");
|
||||
|
||||
pub fn build(b: *std.build.Builder) void {
|
||||
// Standard target options allows the person running `zig build` to choose
|
||||
// what target to build for. Here we do not override the defaults, which
|
||||
// means any target is allowed, and the default is native. Other options
|
||||
// for restricting supported target set are available.
|
||||
const target = b.standardTargetOptions(.{});
|
||||
const optimize = b.standardOptimizeOption(.{});
|
||||
|
||||
// Standard release options allow the person running `zig build` to select
|
||||
// between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall.
|
||||
const mode = b.standardReleaseOptions();
|
||||
|
||||
const exe = b.addExecutable("playtwitch", "src/main.zig");
|
||||
exe.setTarget(target);
|
||||
exe.setBuildMode(mode);
|
||||
//const exe = b.addExecutable("playtwitch", "src/main.zig");
|
||||
const exe = b.addExecutable(.{
|
||||
.name = "playtwitch",
|
||||
.root_source_file = .{ .path = "src/main.zig" },
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
});
|
||||
|
||||
exe.linkLibC();
|
||||
exe.linkSystemLibrary("cimgui");
|
||||
|
@ -21,7 +18,7 @@ pub fn build(b: *std.build.Builder) void {
|
|||
exe.linkSystemLibrary("glew");
|
||||
exe.linkSystemLibrary("curl");
|
||||
|
||||
exe.strip = mode != .Debug;
|
||||
exe.strip = optimize != .Debug and optimize != .ReleaseSafe;
|
||||
|
||||
exe.install();
|
||||
|
||||
|
@ -45,11 +42,4 @@ pub fn build(b: *std.build.Builder) void {
|
|||
|
||||
const run_step = b.step("run", "Run the app");
|
||||
run_step.dependOn(&run_cmd.step);
|
||||
|
||||
const exe_tests = b.addTest("src/main.zig");
|
||||
exe_tests.setTarget(target);
|
||||
exe_tests.setBuildMode(mode);
|
||||
|
||||
const test_step = b.step("test", "Run unit tests");
|
||||
test_step.dependOn(&exe_tests.step);
|
||||
}
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
.{
|
||||
.name = "playtwitch",
|
||||
.version = "0.0.0",
|
||||
|
||||
.dependencies = .{
|
||||
.glib_log = .{
|
||||
.url = "https://mzte.de/git/LordMZTE/zig-glib-log/archive/1db0367ce69812a71003d99cf29a0698d71f2ab4.tar.gz",
|
||||
.hash = "00000000000000000000000000000000000000000000000000000000000000000000",
|
||||
},
|
||||
},
|
||||
}
|
|
@ -153,7 +153,7 @@ pub fn winContent(state: *State) !void {
|
|||
_ = c.igTableSetColumnIndex(2);
|
||||
c.igTableHeader("Live?");
|
||||
|
||||
for (state.channels.?) |entry, i| {
|
||||
for (state.channels.?, 0..) |entry, i| {
|
||||
c.igPushID_Int(@intCast(c_int, i));
|
||||
defer c.igPopID();
|
||||
|
||||
|
|
|
@ -4,12 +4,12 @@
|
|||
|
||||
.dependencies = .{
|
||||
.ansi_term = .{
|
||||
.url = "https://github.com/ziglibs/ansi-term/archive/3238ee3600775a0d2ed52fa5bf30669daebd47cd.tar.gz",
|
||||
.hash = "122054a0aadb65c0b51e0d2b6083272c8ccd59abe83469425c3ea03030e450df4625",
|
||||
.url = "https://github.com/ziglibs/ansi-term/archive/84b2a92970bc3328b1366abb3bffd677bd681669.tar.gz",
|
||||
.hash = "1220d454469ddc251e46fff3b2b11f7016deb54bc5cd8618e809a09a4b1f5304f555",
|
||||
},
|
||||
.known_folders = .{
|
||||
.url = "https://github.com/ziglibs/known-folders/archive/53fe3b676f32e59d46f4fd201d7ab200e5f6cb98.tar.gz",
|
||||
.hash = "12203e18503cd0fa097a4404b0c4f8535a68536886b536ae51c786455238ba5f183b",
|
||||
.url = "https://github.com/ziglibs/known-folders/archive/d13ba6137084e55f873f6afb67447fe8906cc951.tar.gz",
|
||||
.hash = "122028c00915d9b37296059be8a3883c718dbb5bd174350caedf152fed1f46f99607",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ mode: Mode,
|
|||
const Self = @This();
|
||||
|
||||
pub fn parse(s: []const u8) Self {
|
||||
inline for (@typeInfo(Mode).Enum.fields) |field, i| {
|
||||
inline for (@typeInfo(Mode).Enum.fields, 0..) |field, i| {
|
||||
if (std.mem.eql(u8, field.name, s))
|
||||
return .{ .mode = @intToEnum(Mode, i) };
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue