authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-09-05 15:17:23-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-09-05 15:17:23-04:00
log4a5bc89862aca6f1870cbaa7d398ab2eed3022c3
treeb9b7312f9b72c61d63e13db9666042870ca7e9a6
parentb564e7ca59818e4904fc421fc8b1914cefd79538
signaturelock-open Commit is signed but in an unrecognized format.

add -l as an alias for --library


1 files changed, 8 insertions(+), 1 deletions(-)

src/main.cpp+8-1
......@@ -101,6 +101,7 @@ static int print_full_usage(const char *arg0, FILE *file, int return_code) {
101101 " --version-script [path] provide a version .map file\n"
102102 " --object [obj] add object file to build\n"
103103 " -L[dir] alias for --library-path\n"
104 " -l[lib] alias for --library\n"
104105 " -rdynamic add all symbols to the dynamic symbol table\n"
105106 " -rpath [path] add directory to the runtime library search path\n"
106107 " --subsystem [subsystem] (windows) /SUBSYSTEM:<subsystem> to the linker\n"
......@@ -688,6 +689,12 @@ int main(int argc, char **argv) {
688689 } else if (arg[1] == 'L' && arg[2] != 0) {
689690 // alias for --library-path
690691 lib_dirs.append(&arg[2]);
692 } else if (arg[1] == 'l' && arg[2] != 0) {
693 // alias for --library
694 const char *l = &arg[2];
695 if (strcmp(l, "c") == 0)
696 have_libc = true;
697 link_libs.append(l);
691698 } else if (arg[1] == 'F' && arg[2] != 0) {
692699 framework_dirs.append(&arg[2]);
693700 } else if (strcmp(arg, "--pkg-begin") == 0) {
......@@ -778,7 +785,7 @@ int main(int argc, char **argv) {
778785 lib_dirs.append(argv[i]);
779786 } else if (strcmp(arg, "-F") == 0) {
780787 framework_dirs.append(argv[i]);
781 } else if (strcmp(arg, "--library") == 0) {
788 } else if (strcmp(arg, "--library") == 0 || strcmp(arg, "-l") == 0) {
782789 if (strcmp(argv[i], "c") == 0)
783790 have_libc = true;
784791 link_libs.append(argv[i]);