-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.zig
86 lines (77 loc) · 2.33 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
const std = @import("std");
pub fn build(b: *std.Build) void {
const cpputest_dep = b.dependency("cpputest", .{});
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const cpputest = b.addStaticLibrary(.{
.name = "CppUTest",
.target = target,
.optimize = optimize,
.link_libc = true,
});
cpputest.addCSourceFiles(.{
.root = cpputest_dep.path("src/CppUTest"),
.files = &CPPUTEST_SRC,
.flags = &FLAGS,
});
cpputest.installHeadersDirectory(cpputest_dep.path("include/CppUTest"), "CppUTest", .{});
cpputest.addIncludePath(cpputest_dep.path("include"));
cpputest.linkLibCpp();
const cpputest_ext = b.addStaticLibrary(.{
.name = "CppUTestExt",
.target = target,
.optimize = optimize,
.link_libc = true,
});
cpputest_ext.addCSourceFiles(.{
.root = cpputest_dep.path("src/CppUTestExt"),
.files = &CPPUTEST_EXT_SRC,
.flags = &FLAGS,
});
cpputest_ext.installHeadersDirectory(cpputest_dep.path("include/CppUTestExt"), "CppUTestExt", .{});
cpputest_ext.addIncludePath(cpputest_dep.path("include"));
cpputest_ext.linkLibCpp();
b.installArtifact(cpputest);
b.installArtifact(cpputest_ext);
}
const CPPUTEST_SRC = [_][]const u8{
"CommandLineArguments.cpp",
"CommandLineTestRunner.cpp",
"JUnitTestOutput.cpp",
"MemoryLeakDetector.cpp",
"MemoryLeakWarningPlugin.cpp",
"SimpleMutex.cpp",
"SimpleString.cpp",
"SimpleStringInternalCache.cpp",
"TeamCityTestOutput.cpp",
"TestFailure.cpp",
"TestFilter.cpp",
"TestHarness_c.cpp",
"TestMemoryAllocator.cpp",
"TestOutput.cpp",
"TestPlugin.cpp",
"TestRegistry.cpp",
"TestResult.cpp",
"TestTestingFixture.cpp",
"Utest.cpp",
};
const CPPUTEST_EXT_SRC = [_][]const u8{
"CodeMemoryReportFormatter.cpp",
"GTest.cpp",
"IEEE754ExceptionsPlugin.cpp",
"MemoryReportAllocator.cpp",
"MemoryReporterPlugin.cpp",
"MemoryReportFormatter.cpp",
"MockActualCall.cpp",
"MockExpectedCall.cpp",
"MockExpectedCallsList.cpp",
"MockFailure.cpp",
"MockNamedValue.cpp",
"MockSupport_c.cpp",
"MockSupport.cpp",
"MockSupportPlugin.cpp",
"OrderedTest.cpp",
};
const FLAGS = [_][]const u8{
"-std=c++20",
};