mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-29 19:00:06 +00:00
Combines all link-able types to a single if and adds .o for linking
This commit is contained in:
+17
-11
@@ -341,12 +341,15 @@ i32 linker_stage(lbGenerator *gen) {
|
|||||||
String lib_name = lib;
|
String lib_name = lib;
|
||||||
lib_name = remove_extension_from_path(lib_name);
|
lib_name = remove_extension_from_path(lib_name);
|
||||||
lib_str = gb_string_append_fmt(lib_str, " -framework %.*s ", LIT(lib_name));
|
lib_str = gb_string_append_fmt(lib_str, " -framework %.*s ", LIT(lib_name));
|
||||||
} else if (string_ends_with(lib, str_lit(".a"))) {
|
} else if (string_ends_with(lib, str_lit(".a")) ||
|
||||||
|
string_ends_with(lib, str_lit(".o")) ||
|
||||||
|
string_ends_with(lib, str_lit(".dylib")))
|
||||||
|
{
|
||||||
|
// For:
|
||||||
|
// object
|
||||||
|
// dynamic lib
|
||||||
// static libs, absolute full path relative to the file in which the lib was imported from
|
// static libs, absolute full path relative to the file in which the lib was imported from
|
||||||
lib_str = gb_string_append_fmt(lib_str, " %.*s ", LIT(lib));
|
lib_str = gb_string_append_fmt(lib_str, " %.*s ", LIT(lib));
|
||||||
} else if (string_ends_with(lib, str_lit(".dylib"))) {
|
|
||||||
// dynamic lib
|
|
||||||
lib_str = gb_string_append_fmt(lib_str, " %.*s ", LIT(lib));
|
|
||||||
} else {
|
} else {
|
||||||
// dynamic or static system lib, just link regularly searching system library paths
|
// dynamic or static system lib, just link regularly searching system library paths
|
||||||
lib_str = gb_string_append_fmt(lib_str, " -l%.*s ", LIT(lib));
|
lib_str = gb_string_append_fmt(lib_str, " -l%.*s ", LIT(lib));
|
||||||
@@ -2136,13 +2139,16 @@ int main(int arg_count, char const **arg_ptr) {
|
|||||||
String lib_name = lib;
|
String lib_name = lib;
|
||||||
lib_name = remove_extension_from_path(lib_name);
|
lib_name = remove_extension_from_path(lib_name);
|
||||||
lib_str = gb_string_append_fmt(lib_str, " -framework %.*s ", LIT(lib_name));
|
lib_str = gb_string_append_fmt(lib_str, " -framework %.*s ", LIT(lib_name));
|
||||||
} else if (string_ends_with(lib, str_lit(".a"))) {
|
} else if (string_ends_with(lib, str_lit(".a")) ||
|
||||||
// static libs, absolute full path relative to the file in which the lib was imported from
|
string_ends_with(lib, str_lit(".o")) ||
|
||||||
lib_str = gb_string_append_fmt(lib_str, " %.*s ", LIT(lib));
|
string_ends_with(lib, str_lit(".dylib")))
|
||||||
} else if (string_ends_with(lib, str_lit(".dylib"))) {
|
{
|
||||||
// dynamic lib
|
// For:
|
||||||
lib_str = gb_string_append_fmt(lib_str, " %.*s ", LIT(lib));
|
// object
|
||||||
} else {
|
// dynamic lib
|
||||||
|
// static libs, absolute full path relative to the file in which the lib was imported from
|
||||||
|
lib_str = gb_string_append_fmt(lib_str, " %.*s ", LIT(lib));
|
||||||
|
} else {
|
||||||
// dynamic or static system lib, just link regularly searching system library paths
|
// dynamic or static system lib, just link regularly searching system library paths
|
||||||
lib_str = gb_string_append_fmt(lib_str, " -l%.*s ", LIT(lib));
|
lib_str = gb_string_append_fmt(lib_str, " -l%.*s ", LIT(lib));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user