mirror of
https://github.com/odin-lang/Odin.git
synced 2026-01-06 13:07:59 +00:00
Make irGen.output_base use full path rather than relative
This commit is contained in:
@@ -692,3 +692,12 @@ wchar_t **command_line_to_wargv(wchar_t *cmd_line, int *_argc) {
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
String path_to_full_path(gbAllocator a, String path) {
|
||||
gbAllocator ha = heap_allocator();
|
||||
char *path_c = gb_alloc_str_len(ha, cast(char *)path.text, path.len);
|
||||
defer (gb_free(ha, path_c));
|
||||
|
||||
char *fullpath = gb_path_get_full_name(a, path_c);
|
||||
return make_string_c(fullpath);
|
||||
}
|
||||
|
||||
@@ -7766,8 +7766,10 @@ bool ir_gen_init(irGen *s, Checker *c) {
|
||||
s->output_base = substring(s->output_name, 0, pos);
|
||||
}
|
||||
}
|
||||
gbAllocator ha = heap_allocator();
|
||||
s->output_base = path_to_full_path(ha, s->output_base);
|
||||
|
||||
gbString output_file_path = gb_string_make_length(heap_allocator(), s->output_base.text, s->output_base.len);
|
||||
gbString output_file_path = gb_string_make_length(ha, s->output_base.text, s->output_base.len);
|
||||
output_file_path = gb_string_appendc(output_file_path, ".ll");
|
||||
defer (gb_string_free(output_file_path));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user