4 Commits

Author SHA1 Message Date
JailDoctor ae8f476c84 VERSIÓ 2.1.4:
- [NEW] Mostra tots els targets posibles, marcant el que está usant.
2026-06-01 13:52:22 +02:00
JailDoctor 2edb275040 - [FIX] En Windows no se reemplaçaven correctament les barres 2026-05-30 14:05:49 +02:00
JailDoctor 89eae8bd58 - [FIX] Ara soporta que varios arxius en diferents carpetes tinguen el mateix nom 2026-05-14 11:03:05 +02:00
JailDoctor bb30daedae - [FIX] en Windows faltava una capçalera per a compilar 2026-05-13 14:20:26 +02:00
3 changed files with 25 additions and 10 deletions
+3 -1
View File
@@ -1,3 +1,5 @@
lagueirto
.vscode/*
lagueirto.exe
*.exe
*.zip
build/*
+21 -8
View File
@@ -11,6 +11,7 @@
#include <mutex>
#include <queue>
#include <condition_variable>
#include <atomic>
#include "version.h"
@@ -22,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 = "";
@@ -175,14 +176,18 @@ bool loadLagueirtoFile(const std::string &section_to_load)
if (end == std::string::npos) continue;
current_section = line.substr(1, end - 1);
// Detectar si es default
std::string rest = trim_copy(line.substr(end + 1));
found_any_section = true;
if (rest == "default") found_default = true;
if (section_to_load.empty() && rest == "default") active = true;
else active = (current_section == section_to_load);
if (active) loaded_section = current_section;
if (active) {
loaded_section = current_section;
std::cout << " > " << current_section << " < " << std::endl;
} else {
std::cout << " - " << current_section << std::endl;
}
continue;
}
@@ -319,9 +324,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 == '/') 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;
@@ -341,7 +354,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;
@@ -537,7 +550,7 @@ std::cout << " |___/ v" << LAGUEIRTO_VERSION << std::endl;
}
if (must_recompile_all) {
std::cout << "remove: '" << build_path << "'" << std::endl;
std::cout << "Doing a full rebuild" << std::endl;
std::filesystem::remove_all(build_path);
}
+1 -1
View File
@@ -1,3 +1,3 @@
#pragma once
#define LAGUEIRTO_VERSION "2.1.0"
#define LAGUEIRTO_VERSION "2.1.4"