added CLI

This commit is contained in:
Jorijn van der Graaf 2024-12-28 21:26:19 +01:00
commit e108f0859b
3 changed files with 26 additions and 9 deletions

View file

@ -114,12 +114,16 @@ void Project::Build(std::string configuration) {
thread.join();
}
system(std::format("clang++ {}-o {}/{}", files, config.outputDir, name).c_str());
break;
return;
}
}
throw std::runtime_error("Configuration: " + configuration + " not found.");
}
Project Project::LoadFromJSON(std::string file) {
if (!std::filesystem::exists(file)) {
throw std::runtime_error("Project file: " + file + " not found.");
}
std::ifstream f(file);
nlohmann::json data = nlohmann::json::parse(f);
const std::string name = data["name"].get<std::string>();