zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 4a5bc89862aca6f1870cbaa7d398ab2eed3022c3 (tree)
parent b564e7ca59818e4904fc421fc8b1914cefd79538
Author: Andrew Kelley <andrew@ziglang.org>
Date:   Thu,  5 Sep 2019 15:17:23 -0400

add -l as an alias for --library

Diffstat:
Msrc/main.cpp | 9++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/main.cpp b/src/main.cpp @@ -101,6 +101,7 @@ static int print_full_usage(const char *arg0, FILE *file, int return_code) { " --version-script [path] provide a version .map file\n" " --object [obj] add object file to build\n" " -L[dir] alias for --library-path\n" + " -l[lib] alias for --library\n" " -rdynamic add all symbols to the dynamic symbol table\n" " -rpath [path] add directory to the runtime library search path\n" " --subsystem [subsystem] (windows) /SUBSYSTEM:<subsystem> to the linker\n" @@ -688,6 +689,12 @@ int main(int argc, char **argv) { } else if (arg[1] == 'L' && arg[2] != 0) { // alias for --library-path lib_dirs.append(&arg[2]); + } else if (arg[1] == 'l' && arg[2] != 0) { + // alias for --library + const char *l = &arg[2]; + if (strcmp(l, "c") == 0) + have_libc = true; + link_libs.append(l); } else if (arg[1] == 'F' && arg[2] != 0) { framework_dirs.append(&arg[2]); } else if (strcmp(arg, "--pkg-begin") == 0) { @@ -778,7 +785,7 @@ int main(int argc, char **argv) { lib_dirs.append(argv[i]); } else if (strcmp(arg, "-F") == 0) { framework_dirs.append(argv[i]); - } else if (strcmp(arg, "--library") == 0) { + } else if (strcmp(arg, "--library") == 0 || strcmp(arg, "-l") == 0) { if (strcmp(argv[i], "c") == 0) have_libc = true; link_libs.append(argv[i]);