- [FIX] Ara soporta que varios arxius en diferents carpetes tinguen el mateix nom

This commit is contained in:
2026-05-14 11:03:05 +02:00
parent bb30daedae
commit 89eae8bd58
2 changed files with 12 additions and 4 deletions
+11 -3
View File
@@ -320,9 +320,17 @@ bool HeadersNeedRecompile(FileInfo file, std::filesystem::file_time_type object_
return false;
}
bool MustRecompile(FileInfo file) {
std::string object_file = build_path + folder_char + std::filesystem::path(file.filename).stem().string() + ".o";
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 = '.';
return build_path + folder_char + out;
}
bool MustRecompile(FileInfo file) {
std::string object_file = generate_object_file_name(file.filename);
// si el objecte no existeix, fa falta recompilar
if (!std::filesystem::exists(object_file)) {
return true;
@@ -342,7 +350,7 @@ bool MustRecompile(FileInfo file) {
}
void Recompile(std::string source_file) {
std::string object_file = build_path + folder_char + std::filesystem::path(source_file).stem().string() + ".o";
std::string object_file = generate_object_file_name(source_file);
must_link = true;
std::string command = compiler + " " + source_file + " " + cppflags + " -c -o " + object_file;
//std::cout << command << std::endl;
+1 -1
View File
@@ -1,3 +1,3 @@
#pragma once
#define LAGUEIRTO_VERSION "2.1.1"
#define LAGUEIRTO_VERSION "2.1.2"