zig build: add valgrind cli options

master
Andrew Kelley 2019-07-18 20:03:38 -04:00
parent e5d032982e
commit 1d07bbbef2
No known key found for this signature in database
GPG Key ID: 7C5F548F728501A9
1 changed files with 10 additions and 0 deletions

View File

@ -1255,6 +1255,8 @@ pub const LibExeObjStep = struct {
libc_file: ?[]const u8 = null,
target_glibc: ?Version = null,
valgrind_support: ?bool = null,
const LinkObject = union(enum) {
StaticPath: []const u8,
OtherStep: *LibExeObjStep,
@ -1882,6 +1884,14 @@ pub const LibExeObjStep = struct {
try zig_args.append("--system-linker-hack");
}
if (self.valgrind_support) |valgrind_support| {
if (valgrind_support) {
try zig_args.append("--enable-valgrind");
} else {
try zig_args.append("--disable-valgrind");
}
}
if (self.override_std_dir) |dir| {
try zig_args.append("--override-std-dir");
try zig_args.append(builder.pathFromRoot(dir));