mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Print frameworks first on Darwin targets
This commit is contained in:
@@ -449,6 +449,26 @@ gb_internal i32 linker_stage(LinkerData *gen) {
|
|||||||
if (extra_linker_flags.len != 0) {
|
if (extra_linker_flags.len != 0) {
|
||||||
lib_str = gb_string_append_fmt(lib_str, " %.*s", LIT(extra_linker_flags));
|
lib_str = gb_string_append_fmt(lib_str, " %.*s", LIT(extra_linker_flags));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (build_context.metrics.os == TargetOs_darwin) {
|
||||||
|
// Print frameworks first
|
||||||
|
for (String lib : e->LibraryName.paths) {
|
||||||
|
lib = string_trim_whitespace(lib);
|
||||||
|
if (lib.len == 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (string_ends_with(lib, str_lit(".framework"))) {
|
||||||
|
if (string_set_update(&min_libs_set, lib)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
String lib_name = lib;
|
||||||
|
lib_name = remove_extension_from_path(lib_name);
|
||||||
|
lib_str = gb_string_append_fmt(lib_str, " -framework %.*s ", LIT(lib_name));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (String lib : e->LibraryName.paths) {
|
for (String lib : e->LibraryName.paths) {
|
||||||
lib = string_trim_whitespace(lib);
|
lib = string_trim_whitespace(lib);
|
||||||
if (lib.len == 0) {
|
if (lib.len == 0) {
|
||||||
@@ -543,6 +563,8 @@ gb_internal i32 linker_stage(LinkerData *gen) {
|
|||||||
short_circuit = true;
|
short_circuit = true;
|
||||||
} else if (string_ends_with(lib, str_lit(".so"))) {
|
} else if (string_ends_with(lib, str_lit(".so"))) {
|
||||||
short_circuit = true;
|
short_circuit = true;
|
||||||
|
} else if (e->LibraryName.ignore_duplicates) {
|
||||||
|
short_circuit = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (string_set_update(&min_libs_set, lib) && (build_context.min_link_libs || short_circuit)) {
|
if (string_set_update(&min_libs_set, lib) && (build_context.min_link_libs || short_circuit)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user