authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2022-06-24 22:02:15+02:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2022-06-24 22:02:19+02:00
logeadac4763135717ace3a7809ec5d6413b1699fcd
treeab7faff3a1d789c71dd7d50efae65ba41fdecaf3
parentb60938eefd533ccf22675e41c22ffd57bc5d5be1

cli: let the linker resolve libs into dynamic and static

Unlike targeting ELF-based OSes such as Linux, resolving system libs on Darwin should follow one of two strategies: `-search_paths_first` or `-search_dylibs_first` and hence we defer always forcing linking a static library to the linker.

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

src/main.zig+1
......@@ -2152,6 +2152,7 @@ fn buildOutputType(
21522152 }
21532153
21542154 for (lib_dirs.items) |lib_dir_path| {
2155 if (cross_target.isDarwin()) break; // Targeting Darwin we let the linker resolve the libraries in the correct order
21552156 test_path.clearRetainingCapacity();
21562157 try test_path.writer().print("{s}" ++ sep ++ "{s}{s}{s}", .{
21572158 lib_dir_path,