diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2020-08-25 21:31:03 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2020-08-25 22:44:18 -0700 |
| commit | 237d9a105d5eec82aefc63da8e844c47d8990eea (patch) | |
| tree | 24ebeba0e09b069f52871a8869fb8417e2544719 /build.zig | |
| parent | e97157f71c79257ab575598d142f3caa785a2a76 (diff) | |
| download | zig-237d9a105d5eec82aefc63da8e844c47d8990eea.tar.gz zig-237d9a105d5eec82aefc63da8e844c47d8990eea.zip | |
stage2: support debug dumping zir as a build option
So that it's not needed to manually comment and uncomment the debug
code.
Diffstat (limited to 'build.zig')
| -rw-r--r-- | build.zig | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -83,6 +83,7 @@ pub fn build(b: *Builder) !void { } const log_scopes = b.option([]const []const u8, "log", "Which log scopes to enable") orelse &[0][]const u8{}; + const zir_dumps = b.option([]const []const u8, "dump-zir", "Which functions to dump ZIR for before codegen") orelse &[0][]const u8{}; const opt_version_string = b.option([]const u8, "version-string", "Override Zig version string. Default is to find out with git."); const version = if (opt_version_string) |version| version else v: { @@ -103,6 +104,7 @@ pub fn build(b: *Builder) !void { exe.addBuildOption([]const u8, "version", version); exe.addBuildOption([]const []const u8, "log_scopes", log_scopes); + exe.addBuildOption([]const []const u8, "zir_dumps", zir_dumps); exe.addBuildOption(bool, "enable_tracy", tracy != null); if (tracy) |tracy_path| { const client_cpp = fs.path.join( |
