From bdb56768be5bf7a144657f03ff53808f8ff1e65f Mon Sep 17 00:00:00 2001 From: Raimon Zamora Date: Wed, 13 May 2026 12:11:54 +0200 Subject: [PATCH] =?UTF-8?q?Versi=C3=B3=202.0.2:=20-=20[NEW]=20Ara=20es=20g?= =?UTF-8?q?uarda=20un=20arxivet=20que=20especifica=20per=20a=20quin=20targ?= =?UTF-8?q?et=20se=20va=20compilar=20per=20=C3=BAltima=20vegada.=20Si=20no?= =?UTF-8?q?=20coincideix,=20se=20fa=20un=20rebuild=20all.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.cpp | 20 ++++++++++++++++++-- version.h | 2 +- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/main.cpp b/main.cpp index a1329f8..94304da 100644 --- a/main.cpp +++ b/main.cpp @@ -21,6 +21,7 @@ std::string folder_char = "\\"; #else std::string folder_char = "/"; #endif +std::string loaded_section = ""; std::vector exclude; std::vector keys = {"libs", "cppflags", "executable", "sourcepath", "buildpath", "exclude"}; @@ -174,7 +175,7 @@ bool loadLagueirtoFile(const std::string §ion_to_load) 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; continue; } @@ -445,14 +446,29 @@ int main(int argc, char *argv[]) exit(1); } + std::string last_config_file = build_path + folder_char + "last_config"; + if (!std::filesystem::exists(last_config_file)) { + must_recompile_all = true; + } else { + std::ifstream in(last_config_file); + if (in) { + std::string word; + in >> word; + if (word != loaded_section) must_recompile_all = true; + } + } + if (must_recompile_all) { std::cout << "remove: '" << build_path << "'" << std::endl; std::filesystem::remove_all(build_path); } + if (!std::filesystem::is_directory(build_path)) std::filesystem::create_directory(build_path); + std::ofstream out(last_config_file); + if (out) out << loaded_section; + std::chrono::steady_clock::time_point begin_all = std::chrono::steady_clock::now(); - if (!std::filesystem::is_directory(build_path)) std::filesystem::create_directory(build_path); source_paths = split(source_path); // Recopilem tots els arxius cpp i capçaleres diff --git a/version.h b/version.h index 5b14988..0f9bd14 100644 --- a/version.h +++ b/version.h @@ -1,3 +1,3 @@ #pragma once -#define LAGUEIRTO_VERSION "2.0.1" +#define LAGUEIRTO_VERSION "2.0.2"