BGXEO47UTCDVQCRC5YMVQ3U326WVDULVQJ7MTLPZ7PMBQANJ5Z2AC
termState.lflag &= ~@as(linux.tcflag_t, linux.ECHO | linux.ECHONL | linux.ICANON |
linux.ISIG | linux.IEXTEN);
termState.iflag &= ~@as(linux.tcflag_t, linux.IXON | linux.ICRNL | linux.INLCR |
linux.BRKINT | linux.IGNBRK | linux.PARMRK | linux.ISTRIP | linux.IGNCR);
termState.oflag &= ~@as(linux.tcflag_t, linux.OPOST);
termState.cflag &= ~@as(linux.tcflag_t, linux.CSIZE | linux.PARENB);
// termState.lflag &= ~@as(linux.tcflag_t, linux.ECHO | linux.ECHONL | linux.ICANON |
// linux.ISIG | linux.IEXTEN);
// termState.iflag &= ~@as(linux.tcflag_t, linux.IXON | linux.ICRNL | linux.INLCR |
// linux.BRKINT | linux.IGNBRK | linux.PARMRK | linux.ISTRIP | linux.IGNCR);
// termState.oflag &= ~@as(linux.tcflag_t, linux.OPOST);
// termState.cflag &= ~@as(linux.tcflag_t, linux.CSIZE | linux.PARENB);
termState.lflag = std.posix.tc_lflag_t{
.ECHO = false,
.ECHONL = false,
.ICANON = false,
.ISIG = false,
.IEXTEN = false,
};
termState.iflag = std.posix.tc_iflag_t{
.IXON = false,
.ICRNL = false,
.INLCR = false,
.BRKINT = false,
.IGNBRK = false,
.PARMRK = false,
.ISTRIP = false,
.IGNCR = false,
};
termState.oflag = std.posix.tc_oflag_t{
.OPOST = false,
};
termState.cflag = std.posix.tc_cflag_t{
.CSIZE = .CS8,
.PARENB = false,
};
// Standard release options allow the person running `zig build` to select
// between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall.
const mode = b.standardReleaseOptions();
// Standard optimization options allow the person running `zig build` to select
// between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall. Here we do not
// set a preferred release mode, allowing the user to decide how to optimize.
const optimize = b.standardOptimizeOption(.{});
const exe = b.addExecutable(.{
.name = "kilo",
.root_source_file = b.path("src/main.zig"),
.target = target,
.optimize = optimize,
});
const exe = b.addExecutable("kilo", "src/main.zig");
exe.setTarget(target);
exe.setBuildMode(mode);
exe.install();
// This declares intent for the executable to be installed into the
// standard location when the user invokes the "install" step (the default
// step when running `zig build`).
b.installArtifact(exe);
// This *creates* a Run step in the build graph, to be executed when another
// step is evaluated that depends on it. The next line below will establish
// such a dependency.
const run_cmd = b.addRunArtifact(exe);
const run_cmd = exe.run();
// By making the run step depend on the install step, it will be run from the
// installation directory rather than directly from within the cache directory.
// This is not necessary, however, if the application depends on other installed
// files, this ensures they will be present and in the expected location.
const exe_unit_tests = b.addTest(.{
.root_source_file = b.path("src/main.zig"),
.target = target,
.optimize = optimize,
});
const run_exe_unit_tests = b.addRunArtifact(exe_unit_tests);
// Similar to creating the run step earlier, this exposes a `test` step to
// the `zig build --help` menu, providing a way for the user to request
// running the unit tests.
const test_step = b.step("test", "Run unit tests");
test_step.dependOn(&run_exe_unit_tests.step);