-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.zig
41 lines (36 loc) · 1.35 KB
/
build.zig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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);
}