- [FIX] En Windows no se reemplaçaven correctament les barres

This commit is contained in:
2026-05-30 14:05:49 +02:00
parent 89eae8bd58
commit 2edb275040
3 changed files with 6 additions and 5 deletions
+3 -3
View File
@@ -23,9 +23,9 @@ std::vector<std::string> source_paths;
std::string build_path = "";
std::string compiler = "g++";
#ifdef _WIN32
std::string folder_char = "\\";
char folder_char = '\\';
#else
std::string folder_char = "/";
char folder_char = '/';
#endif
std::string loaded_section = "";
@@ -324,7 +324,7 @@ std::string generate_object_file_name(std::string filename) {
std::filesystem::path cwd = std::filesystem::weakly_canonical(std::filesystem::current_path());
std::filesystem::path target = std::filesystem::weakly_canonical(filename);
std::string out = std::filesystem::relative(target, cwd).replace_extension("o").generic_string();
for (char& c : out) if (c == folder_char[0]) c = '.';
for (char& c : out) if (c == '/') c = '.';
return build_path + folder_char + out;
}