V2 progress

This commit is contained in:
Jorijn van der Graaf 2026-04-23 01:57:25 +02:00
commit 5e1fcd8590
9837 changed files with 790 additions and 1708518 deletions

View file

@ -45,23 +45,24 @@ namespace Crafter {
return true;
}
}
void Implementation::Compile(const std::string_view clang, const fs::path& buildDir, std::string& result) const {
void Implementation::Compile(const std::string_view clang, const fs::path& buildDir, std::atomic<bool>& buildCancelled, std::string& buildError) const {
for(ModulePartition* dependency : partitionDependencies) {
if(!dependency->compiled.load()) {
dependency->compiled.wait(CRAFTER_COMPILE_STATUS_WAITING);
if(dependency->compiled.load() == CRAFTER_COMPILE_STATUS_ERROR) {
return;
}
dependency->compiled.wait(true);
}
}
for(Module* dependency : moduleDependencies) {
if(!dependency->compiled.load()) {
dependency->compiled.wait(CRAFTER_COMPILE_STATUS_WAITING);
if(dependency->compiled.load() == CRAFTER_COMPILE_STATUS_ERROR) {
return;
}
dependency->compiled.wait(true);
}
}
result = RunClang(std::format("{} {}.cpp -c -o {}_impl.o", clang, path.string(), (buildDir/path.filename()).string()));
if (!buildCancelled.load(std::memory_order_relaxed)) {
return;
}
std::string result = RunCommand(std::format("{} {}.cpp -c -o {}_impl.o", clang, path.string(), (buildDir/path.filename()).string()));
}
}