Skip to content

Commit

Permalink
CI: build test with zigCC
Browse files Browse the repository at this point in the history
  • Loading branch information
kassane committed Jan 18, 2024
1 parent 66a7c55 commit c447600
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ jobs:
sudo apt-get update
sudo apt-get install libglu1-mesa-dev mesa-common-dev xorg-dev libasound-dev
- name: Build
- name: Build Summary
run: zig build -DzigCC --summary all

- name: Test
run: zig build test
- name: Running Test
if: runner.os != 'Windows'
run: zig build test -DzigCC
20 changes: 11 additions & 9 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ pub fn build(b: *Build) !void {
if (enable_zigcc) {
const zcc = buildZigCC(b);
const install = b.addInstallArtifact(zcc, .{ .dest_dir = .{ .override = .{ .custom = "tools" } } });
b.default_step.dependOn(&install.step);
b.getInstallStep().dependOn(&install.step);
}

// build examples
Expand Down Expand Up @@ -233,14 +233,16 @@ pub fn build(b: *Build) !void {
buildShaders(b);

// build tests
const math_test = try ldcBuildStep(b, .{
.name = "test-math",
.kind = .@"test",
.target = b.host,
.sources = &.{b.fmt("{s}/src/handmade/math.d", .{rootPath()})},
.dflags = &.{},
});
b.default_step.dependOn(&math_test.step);
// fixme: not building on Windows libsokol w/ king test
if (target.result.os.tag != .windows) {
_ = try ldcBuildStep(b, .{
.name = "test-math",
.kind = .@"test",
.target = b.host,
.sources = &.{b.fmt("{s}/src/handmade/math.d", .{rootPath()})},
.dflags = &.{},
});
}
}

// Use LDC2 (https://github.com/ldc-developers/ldc) to compile the D examples
Expand Down

0 comments on commit c447600

Please sign in to comment.