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) {...@@ -101,6 +101,7 @@ static int print_full_usage(const char *arg0, FILE *file, int return_code) {
101 " --version-script [path] provide a version .map file\n"101 " --version-script [path] provide a version .map file\n"
102 " --object [obj] add object file to build\n"102 " --object [obj] add object file to build\n"
103 " -L[dir] alias for --library-path\n"103 " -L[dir] alias for --library-path\n"
104 " -l[lib] alias for --library\n"
104 " -rdynamic add all symbols to the dynamic symbol table\n"105 " -rdynamic add all symbols to the dynamic symbol table\n"
105 " -rpath [path] add directory to the runtime library search path\n"106 " -rpath [path] add directory to the runtime library search path\n"
106 " --subsystem [subsystem] (windows) /SUBSYSTEM:<subsystem> to the linker\n"107 " --subsystem [subsystem] (windows) /SUBSYSTEM:<subsystem> to the linker\n"
...@@ -688,6 +689,12 @@ int main(int argc, char **argv) {...@@ -688,6 +689,12 @@ int main(int argc, char **argv) {
688 } else if (arg[1] == 'L' && arg[2] != 0) {689 } else if (arg[1] == 'L' && arg[2] != 0) {
689 // alias for --library-path690 // alias for --library-path
690 lib_dirs.append(&arg[2]);691 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);
691 } else if (arg[1] == 'F' && arg[2] != 0) {698 } else if (arg[1] == 'F' && arg[2] != 0) {
692 framework_dirs.append(&arg[2]);699 framework_dirs.append(&arg[2]);
693 } else if (strcmp(arg, "--pkg-begin") == 0) {700 } else if (strcmp(arg, "--pkg-begin") == 0) {
...@@ -778,7 +785,7 @@ int main(int argc, char **argv) {...@@ -778,7 +785,7 @@ int main(int argc, char **argv) {
778 lib_dirs.append(argv[i]);785 lib_dirs.append(argv[i]);
779 } else if (strcmp(arg, "-F") == 0) {786 } else if (strcmp(arg, "-F") == 0) {
780 framework_dirs.append(argv[i]);787 framework_dirs.append(argv[i]);
781 } else if (strcmp(arg, "--library") == 0) {788 } else if (strcmp(arg, "--library") == 0 || strcmp(arg, "-l") == 0) {
782 if (strcmp(argv[i], "c") == 0)789 if (strcmp(argv[i], "c") == 0)
783 have_libc = true;790 have_libc = true;
784 link_libs.append(argv[i]);791 link_libs.append(argv[i]);