3 Commits

3 changed files with 17 additions and 7 deletions
+2 -1
View File
@@ -1,3 +1,4 @@
lagueirto
.vscode/*
lagueirto.exe
*.exe
*.zip
+14 -5
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 = "";
@@ -319,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 == '/') 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 +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.0"
#define LAGUEIRTO_VERSION "2.1.3"