The absolute path to the object file is not created correctly if the
object file doesn’t already exist.
const std::string& output_obj,
string_view suffix)
{
- const std::string prefix =
- debug_dir.empty() ? output_obj : debug_dir + Util::real_path(output_obj);
+ auto prefix = debug_dir.empty()
+ ? output_obj
+ : debug_dir + util::to_absolute_path(output_obj);
+#ifdef _WIN32
+ prefix.erase(std::remove(prefix.begin(), prefix.end(), ':'), prefix.end());
+#endif
try {
Util::ensure_dir_exists(Util::dir_name(prefix));
} catch (Error&) {