Fix for -use-single-module

This commit is contained in:
gingerBill
2025-03-01 15:19:46 +00:00
parent bb20b03f2e
commit 211680569f
+9 -6
View File
@@ -2562,9 +2562,10 @@ gb_internal String lb_filepath_ll_for_module(lbModule *m) {
GB_ASSERT(m->module_name != nullptr);
String s = make_string_c(m->module_name);
String prefix = str_lit("odin_package-");
GB_ASSERT(string_starts_with(s, prefix));
s.text += prefix.len;
s.len -= prefix.len;
if (string_starts_with(s, prefix)) {
s.text += prefix.len;
s.len -= prefix.len;
}
path = concatenate_strings(permanent_allocator(), path, s);
path = concatenate_strings(permanent_allocator(), s, STR_LIT(".ll"));
@@ -2595,14 +2596,16 @@ gb_internal String lb_filepath_obj_for_module(lbModule *m) {
GB_ASSERT(m->module_name != nullptr);
String s = make_string_c(m->module_name);
String prefix = str_lit("odin_package");
GB_ASSERT(string_starts_with(s, prefix));
s.text += prefix.len;
s.len -= prefix.len;
if (string_starts_with(s, prefix)) {
s.text += prefix.len;
s.len -= prefix.len;
}
path = gb_string_append_length(path, s.text, s.len);
}
if (use_temporary_directory) {
// NOTE(bill): this must be suffixed to ensure it is not conflicting with anything else in the temporary directory
path = gb_string_append_fmt(path, "-%p", m);
}