From 5612b9e1de36de4c09d697366c94df0ceb1574fa Mon Sep 17 00:00:00 2001 From: water Date: Tue, 8 Sep 2020 19:57:58 -0400 Subject: [PATCH] fix again --- goalc/compiler/compilation/CompilerControl.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/goalc/compiler/compilation/CompilerControl.cpp b/goalc/compiler/compilation/CompilerControl.cpp index ae85bc07e..6d09bf906 100644 --- a/goalc/compiler/compilation/CompilerControl.cpp +++ b/goalc/compiler/compilation/CompilerControl.cpp @@ -63,7 +63,13 @@ Val* Compiler::compile_asm_file(const goos::Object& form, const goos::Object& re timing.emplace_back("read", reader_timer.getMs()); Timer compile_timer; - std::string obj_file_name = basename(filename.c_str()); + std::string obj_file_name = filename; + for (int idx = int(filename.size()) - 1; idx-- > 0;) { + if (filename.at(idx) == '\\' || filename.at(idx) == '/') { + obj_file_name = filename.substr(idx + 1); + } + } + obj_file_name = obj_file_name.substr(0, obj_file_name.find_last_of('.')); auto obj_file = compile_object_file(obj_file_name, code, !no_code); timing.emplace_back("compile", compile_timer.getMs());