diff options
| author | gingerBill <bill@gingerbill.org> | 2025-01-22 13:01:06 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2025-01-22 13:01:06 +0000 |
| commit | d6633639dc820e564b41f8dd422b424b0a9dcbec (patch) | |
| tree | a6813500643ace1bd95660cd799f5df9a0689963 /src/linker.cpp | |
| parent | 36e86ba552afeaeb0c54fa43bcffa37562521ff3 (diff) | |
Remove duplicates of .framework/.dynlib/.so in linker
Diffstat (limited to 'src/linker.cpp')
| -rw-r--r-- | src/linker.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/linker.cpp b/src/linker.cpp index 261d6e7a4..59e6d8dc1 100644 --- a/src/linker.cpp +++ b/src/linker.cpp @@ -536,7 +536,16 @@ gb_internal i32 linker_stage(LinkerData *gen) { } array_add(&gen->output_object_paths, obj_file); } else { - if (string_set_update(&min_libs_set, lib) && build_context.min_link_libs) { + bool short_circuit = false; + if (string_ends_with(lib, str_lit(".framework"))) { + short_circuit = true; + } else if (string_ends_with(lib, str_lit(".dylib"))) { + short_circuit = true; + } else if (string_ends_with(lib, str_lit(".so"))) { + short_circuit = true; + } + + if (string_set_update(&min_libs_set, lib) && (build_context.min_link_libs || short_circuit)) { continue; } |