Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions build/0.11.zig
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@ pub fn build(b: *Build) void {
while (iterate.next()) |val| {
if (val) |entry| {
// get the entry name, entry can be file or directory
const name = entry.name;
const output_name = std.mem.trimRight(u8, entry.name, ".zig");
if (entry.kind == .file) {
// connect path
const path = std.fs.path.join(b.allocator, &[_][]const u8{ relative_path, name }) catch |err| {
const path = std.fs.path.join(b.allocator, &[_][]const u8{ relative_path, entry.name }) catch |err| {
log.err("fmt path for examples failed, err is {}", .{err});
std.os.exit(1);
};

// build exe
const exe = b.addExecutable(.{
.name = name,
.name = output_name,
.root_source_file = .{ .path = path },
.target = target,
.optimize = optimize,
Expand All @@ -68,7 +68,7 @@ pub fn build(b: *Build) void {
var child = ChildProcess.init(&args, b.allocator);

// build cwd
const cwd = std.fs.path.join(b.allocator, &[_][]const u8{ full_path, name }) catch |err| {
const cwd = std.fs.path.join(b.allocator, &[_][]const u8{ full_path, entry.name }) catch |err| {
log.err("fmt path for examples failed, err is {}", .{err});
std.os.exit(1);
};
Expand Down
8 changes: 4 additions & 4 deletions build/0.12.zig
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,18 @@ pub fn build(b: *Build) void {
while (iterate.next()) |val| {
if (val) |entry| {
// get the entry name, entry can be file or directory
const name = entry.name;
const output_name = std.mem.trimRight(u8, entry.name, ".zig");
if (entry.kind == .file) {

// connect path
const path = std.fs.path.join(b.allocator, &[_][]const u8{ relative_path, name }) catch |err| {
const path = std.fs.path.join(b.allocator, &[_][]const u8{ relative_path, entry.name }) catch |err| {
log.err("fmt path for examples failed, err is {}", .{err});
std.process.exit(1);
};

// build exe
const exe = b.addExecutable(.{
.name = name,
.name = output_name,
.root_source_file = b.path(path),
.target = target,
.optimize = optimize,
Expand All @@ -70,7 +70,7 @@ pub fn build(b: *Build) void {
// build cwd
const cwd = std.fs.path.join(b.allocator, &[_][]const u8{
full_path,
name,
entry.name,
}) catch |err| {
log.err("fmt path for examples failed, err is {}", .{err});
std.process.exit(1);
Expand Down
11 changes: 4 additions & 7 deletions build/0.13.zig
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,18 @@ pub fn build(b: *Build) void {
while (iterate.next()) |val| {
if (val) |entry| {
// get the entry name, entry can be file or directory
const name = entry.name;
const output_name = std.mem.trimRight(u8, entry.name, ".zig");
if (entry.kind == .file) {

// connect path
const path = std.fs.path.join(b.allocator, &[_][]const u8{ relative_path, name }) catch |err| {
const path = std.fs.path.join(b.allocator, &[_][]const u8{ relative_path, entry.name }) catch |err| {
log.err("fmt path for examples failed, err is {}", .{err});
std.process.exit(1);
};

// build exe
const exe = b.addExecutable(.{
.name = name,
.name = output_name,
.root_source_file = b.path(path),
.target = target,
.optimize = optimize,
Expand All @@ -68,10 +68,7 @@ pub fn build(b: *Build) void {
var child = ChildProcess.init(&args, b.allocator);

// build cwd
const cwd = std.fs.path.join(b.allocator, &[_][]const u8{
full_path,
name,
}) catch |err| {
const cwd = std.fs.path.join(b.allocator, &[_][]const u8{ full_path, entry.name }) catch |err| {
log.err("fmt path for examples failed, err is {}", .{err});
std.process.exit(1);
};
Expand Down
8 changes: 4 additions & 4 deletions build/0.14.zig
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,18 @@ pub fn build(b: *Build) void {
while (iterate.next()) |val| {
if (val) |entry| {
// get the entry name, entry can be file or directory
const name = entry.name;
const output_name = std.mem.trimRight(u8, entry.name, ".zig");
if (entry.kind == .file) {

// connect path
const path = std.fs.path.join(b.allocator, &[_][]const u8{ relative_path, name }) catch |err| {
const path = std.fs.path.join(b.allocator, &[_][]const u8{ relative_path, entry.name }) catch |err| {
log.err("fmt path for examples failed, err is {}", .{err});
std.process.exit(1);
};

// build exe
const exe = b.addExecutable(.{
.name = name,
.name = output_name,
.root_source_file = b.path(path),
.target = target,
.optimize = optimize,
Expand All @@ -70,7 +70,7 @@ pub fn build(b: *Build) void {
// build cwd
const cwd = std.fs.path.join(b.allocator, &[_][]const u8{
full_path,
name,
entry.name,
}) catch |err| {
log.err("fmt path for examples failed, err is {}", .{err});
std.process.exit(1);
Expand Down