From 56086d11a463297eea3a52ad8e6b245ed397029f Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sat, 26 Sep 2020 02:16:10 -0700 Subject: [PATCH] stage0: update CLI to match stage2 --- BRANCH_TODO | 1 + src/stage1/zig0.cpp | 15 +++++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/BRANCH_TODO b/BRANCH_TODO index 05c6f26612..b5cba8805e 100644 --- a/BRANCH_TODO +++ b/BRANCH_TODO @@ -4,6 +4,7 @@ * tests passing with -Dskip-non-native * `-ftime-report` * -fstack-report print stack size diagnostics\n" + * subsystem * mingw-w64 * MachO LLD linking * COFF LLD linking diff --git a/src/stage1/zig0.cpp b/src/stage1/zig0.cpp index 7fd20c524e..e63c68bc94 100644 --- a/src/stage1/zig0.cpp +++ b/src/stage1/zig0.cpp @@ -36,9 +36,10 @@ static int print_full_usage(const char *arg0, FILE *file, int return_code) { " --output-dir [dir] override output directory (defaults to cwd)\n" " --pkg-begin [name] [path] make pkg available to import and push current pkg\n" " --pkg-end pop current pkg\n" - " --release-fast build with optimizations on and safety off\n" - " --release-safe build with optimizations on and safety on\n" - " --release-small build with size optimizations on and safety off\n" + " -ODebug build with optimizations on and safety off\n" + " -OReleaseFast build with optimizations on and safety off\n" + " -OReleaseSafe build with optimizations on and safety on\n" + " -OReleaseSmall build with size optimizations on and safety off\n" " --single-threaded source may assume it is only used single-threaded\n" " -dynamic create a shared library (.so; .dll; .dylib)\n" " --strip exclude debug symbols\n" @@ -267,11 +268,13 @@ int main(int argc, char **argv) { if (arg[0] == '-') { if (strcmp(arg, "--") == 0) { fprintf(stderr, "Unexpected end-of-parameter mark: %s\n", arg); - } else if (strcmp(arg, "--release-fast") == 0) { + } else if (strcmp(arg, "-ODebug") == 0) { + optimize_mode = BuildModeDebug; + } else if (strcmp(arg, "-OReleaseFast") == 0) { optimize_mode = BuildModeFastRelease; - } else if (strcmp(arg, "--release-safe") == 0) { + } else if (strcmp(arg, "-OReleaseSafe") == 0) { optimize_mode = BuildModeSafeRelease; - } else if (strcmp(arg, "--release-small") == 0) { + } else if (strcmp(arg, "-OReleaseSmall") == 0) { optimize_mode = BuildModeSmallRelease; } else if (strcmp(arg, "--help") == 0) { return print_full_usage(arg0, stdout, EXIT_SUCCESS);