authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-08-02 11:04:59-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-08-03 09:52:15-07:00
loga0e94ec576428e3b9f003c95e6538cb57f029263
tree48c4cc644d51578f7e7a0ad1a7d444cd0b74e8b5
parent986a3d23abcbdb61fd733d2340d4872b6ee55dca

CLI: add -search_paths_first_static to complete the API

There was no previous way to set preferred mode static, search strategy paths_first.

1 files changed, 7 insertions(+), 2 deletions(-)

src/main.zig+7-2
......@@ -477,9 +477,13 @@ const usage_build_generic =
477477 \\ -l[lib], --library [lib] Link against system library (only if actually used)
478478 \\ -needed-l[lib], Link against system library (even if unused)
479479 \\ --needed-library [lib]
480 \\ -weak-l[lib] link against system library marking it and all
481 \\ -weak_library [lib] referenced symbols as weak
480482 \\ -L[d], --library-directory [d] Add a directory to the library search path
481483 \\ -search_paths_first For each library search path, check for dynamic
482484 \\ lib then static lib before proceeding to next path.
485 \\ -search_paths_first_static For each library search path, check for static
486 \\ lib then dynamic lib before proceeding to next path.
483487 \\ -search_dylibs_first Search for dynamic libs in all library search
484488 \\ paths, then static libs.
485489 \\ -search_static_first Search for static libs in all library search
......@@ -536,8 +540,6 @@ const usage_build_generic =
536540 \\ --subsystem [subsystem] (Windows) /SUBSYSTEM:<subsystem> to the linker
537541 \\ --stack [size] Override default stack size
538542 \\ --image-base [addr] Set base address for executable image
539 \\ -weak-l[lib] link against system library and mark it and all referenced symbols as weak
540 \\ -weak_library [lib]
541543 \\ -framework [name] (Darwin) link against framework
542544 \\ -needed_framework [name] (Darwin) link against framework (even if unused)
543545 \\ -needed_library [lib] link against system library (even if unused)
......@@ -1112,6 +1114,9 @@ fn buildOutputType(
11121114 } else if (mem.eql(u8, arg, "-search_paths_first")) {
11131115 lib_search_strategy = .paths_first;
11141116 lib_preferred_mode = .Dynamic;
1117 } else if (mem.eql(u8, arg, "-search_paths_first_static")) {
1118 lib_search_strategy = .paths_first;
1119 lib_preferred_mode = .Static;
11151120 } else if (mem.eql(u8, arg, "-search_dylibs_first")) {
11161121 lib_search_strategy = .mode_first;
11171122 lib_preferred_mode = .Dynamic;