mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Fix -export-linked-libs-file issue where it multiple libraries in a single foreign export.
This commit is contained in:
+11
-11
@@ -2289,9 +2289,10 @@ gb_internal void export_linked_libraries(LinkerData *gen) {
|
|||||||
|
|
||||||
for (auto *e : gen->foreign_libraries) {
|
for (auto *e : gen->foreign_libraries) {
|
||||||
GB_ASSERT(e->kind == Entity_LibraryName);
|
GB_ASSERT(e->kind == Entity_LibraryName);
|
||||||
|
ast_node(imp, ForeignImportDecl, e->LibraryName.decl);
|
||||||
|
|
||||||
for (auto lib_path : e->LibraryName.paths) {
|
for (isize i = 0; i < e->LibraryName.paths.count; i++) {
|
||||||
lib_path = string_trim_whitespace(lib_path);
|
String lib_path = string_trim_whitespace(e->LibraryName.paths[i]);
|
||||||
if (lib_path.len == 0) {
|
if (lib_path.len == 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -2312,16 +2313,15 @@ gb_internal void export_linked_libraries(LinkerData *gen) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
gb_fprintf(&f, "\t");
|
gb_fprintf(&f, "\t");
|
||||||
ast_node(imp, ForeignImportDecl, e->LibraryName.decl);
|
|
||||||
for (Ast* file_path : imp->filepaths) {
|
|
||||||
GB_ASSERT(file_path->tav.mode == Addressing_Constant && file_path->tav.value.kind == ExactValue_String);
|
|
||||||
String file_path_str = file_path->tav.value.value_string;
|
|
||||||
|
|
||||||
if (string_starts_with(file_path_str, str_lit("system:"))) {
|
Ast *file_path = imp->filepaths[i];
|
||||||
gb_fprintf(&f, "system");
|
GB_ASSERT(file_path->tav.mode == Addressing_Constant && file_path->tav.value.kind == ExactValue_String);
|
||||||
} else {
|
String file_path_str = file_path->tav.value.value_string;
|
||||||
gb_fprintf(&f, "user");
|
|
||||||
}
|
if (string_starts_with(file_path_str, str_lit("system:"))) {
|
||||||
|
gb_fprintf(&f, "system");
|
||||||
|
} else {
|
||||||
|
gb_fprintf(&f, "user");
|
||||||
}
|
}
|
||||||
|
|
||||||
gb_fprintf(&f, "\n");
|
gb_fprintf(&f, "\n");
|
||||||
|
|||||||
Reference in New Issue
Block a user