Versió 2.0.2:
- [NEW] Ara es guarda un arxivet que especifica per a quin target se va compilar per última vegada. Si no coincideix, se fa un rebuild all.
This commit is contained in:
@@ -21,6 +21,7 @@ std::string folder_char = "\\";
|
||||
#else
|
||||
std::string folder_char = "/";
|
||||
#endif
|
||||
std::string loaded_section = "";
|
||||
|
||||
std::vector<std::string> exclude;
|
||||
std::vector<std::string> 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
|
||||
|
||||
Reference in New Issue
Block a user