-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 71e3678
Showing
4 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
zig-out | ||
.zig-cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Copyright (c) Matthew Knight | ||
|
||
This software is provided 'as-is', without any express or implied warranty. In | ||
no event will the authors be held liable for any damages arising from the use | ||
of this software. | ||
|
||
Permission is granted to anyone to use this software for any purpose, including | ||
commercial applications, and to alter it and redistribute it freely, subject to | ||
the following restrictions: | ||
|
||
1. The origin of this software must not be misrepresented; you must not claim | ||
that you wrote the original software. If you use this software in a product, | ||
an acknowledgment in the product documentation would be appreciated but is | ||
not required. | ||
|
||
2. Altered source versions must be plainly marked as such, and must not be | ||
misrepresented as being the original software. | ||
|
||
3. This notice may not be removed or altered from any source distribution. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
const std = @import("std"); | ||
|
||
pub fn build(b: *std.Build) void { | ||
const target = b.standardTargetOptions(.{}); | ||
const optimize = b.standardOptimizeOption(.{}); | ||
|
||
const googletest_dep = b.dependency("googletest", .{}); | ||
|
||
const gtest = b.addStaticLibrary(.{ | ||
.name = "gtest", | ||
.target = target, | ||
.optimize = optimize, | ||
.link_libc = true, | ||
}); | ||
gtest.linkLibCpp(); | ||
gtest.addCSourceFile(.{ | ||
.file = googletest_dep.path("googletest/src/gtest-all.cc"), | ||
.flags = &.{}, | ||
}); | ||
gtest.addIncludePath(googletest_dep.path("googletest/include")); | ||
gtest.addIncludePath(googletest_dep.path("googletest")); | ||
gtest.installHeadersDirectory(googletest_dep.path("googletest/include"), ".", .{}); | ||
|
||
b.installArtifact(gtest); | ||
|
||
const gtest_main = b.addStaticLibrary(.{ | ||
.name = "gtest_main", | ||
.target = target, | ||
.optimize = optimize, | ||
.link_libc = true, | ||
}); | ||
gtest_main.linkLibCpp(); | ||
gtest_main.addCSourceFile(.{ | ||
.file = googletest_dep.path("googletest/src/gtest_main.cc"), | ||
.flags = &.{}, | ||
}); | ||
gtest_main.addIncludePath(googletest_dep.path("googletest/include")); | ||
gtest_main.addIncludePath(googletest_dep.path("googletest")); | ||
gtest_main.installHeadersDirectory(googletest_dep.path("googletest/include"), ".", .{}); | ||
b.installArtifact(gtest_main); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
.{ | ||
.name = "googletest", | ||
.version = "1.15.2", | ||
.dependencies = .{ | ||
.googletest = .{ | ||
.url = "https://github.com/google/googletest/archive/refs/tags/v1.15.2.tar.gz", | ||
.hash = "122001093b5794ecf5a5b53887622c75d633af2b0c3402a266ce45c6aa4d179c53ba", | ||
}, | ||
}, | ||
.paths = .{ | ||
"build.zig", | ||
"build.zig.zon", | ||
"LICENSE", | ||
}, | ||
} |