Skip to content
Closed
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
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ jobs:
submodules: recursive

- name: Setup Zig
uses: mlugg/setup-zig@v1
uses: mlugg/setup-zig@v2
with:
version: 0.13.0
version: 0.15.2

- name: Build
run: zig build -Dtarget=${{ matrix.target }} -Doptimize=${{ matrix.optimize }}
24 changes: 14 additions & 10 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ pub fn build(b: *std.Build) void {

const googletest_dep = b.dependency("googletest", .{});

const gtest = b.addStaticLibrary(.{
const gtest = b.addLibrary(.{
.name = "gtest",
.target = target,
.optimize = optimize,
.link_libc = true,
.root_module = b.createModule(.{
.target = target,
.optimize = optimize,
.link_libc = true,
.link_libcpp = true,
}),
});
gtest.linkLibCpp();
gtest.addCSourceFile(.{
.file = googletest_dep.path("googletest/src/gtest-all.cc"),
.flags = &.{},
Expand All @@ -23,13 +25,15 @@ pub fn build(b: *std.Build) void {

b.installArtifact(gtest);

const gtest_main = b.addStaticLibrary(.{
const gtest_main = b.addLibrary(.{
.name = "gtest_main",
.target = target,
.optimize = optimize,
.link_libc = true,
.root_module = b.createModule(.{
.target = target,
.optimize = optimize,
.link_libc = true,
.link_libcpp = true,
}),
});
gtest_main.linkLibCpp();
gtest_main.addCSourceFile(.{
.file = googletest_dep.path("googletest/src/gtest_main.cc"),
.flags = &.{},
Expand Down
3 changes: 2 additions & 1 deletion build.zig.zon
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.{
.name = "googletest",
.name = .googletest,
.fingerprint = 0xc36e6f7a9bb39c58,
.version = "1.15.2",
.dependencies = .{
.googletest = .{
Expand Down