This commit is contained in:
Jorijn van der Graaf 2025-02-12 21:35:25 +01:00
commit af7eb61c3d
2 changed files with 28 additions and 10 deletions

View file

@ -100,11 +100,17 @@ void ModuleFile::Compile(std::string clangDir, const Configuration& config, fs::
flags+=flag;
}
system(std::format("{} -std={} {}.cppm --precompile -march={} {} -fprebuilt-module-path={} -o {}.pcm {}", clangDir, config.standard, path.generic_string(), config.march, flags, pcmDir.generic_string(), (pcmDir/path.filename()).generic_string(), target).c_str());
std::string march;
if(config.target != "wasm32-unknown-wasi"){
march = std::format("-march={}", config.march);
}
system(std::format("{} -std={} {}.cppm --precompile {} {} -fprebuilt-module-path={} -o {}.pcm {}", clangDir, config.standard, path.generic_string(), march, flags, pcmDir.generic_string(), (pcmDir/path.filename()).generic_string(), target).c_str());
recompiled = true;
fileMutex.unlock();
system(std::format("{} -std={} {}.pcm -fprebuilt-module-path={} -c -O{} -march={} {} -o {}.o {}", clangDir, config.standard, (pcmDir/path.filename()).generic_string(), pcmDir.generic_string(), config.optimizationLevel, config.march, flags, (config.buildDir/path.filename()).generic_string(), target).c_str());
system(std::format("{} -std={} {}.pcm -fprebuilt-module-path={} -c -O{} {} {} -o {}.o {}", clangDir, config.standard, (pcmDir/path.filename()).generic_string(), pcmDir.generic_string(), config.optimizationLevel, march, flags, (config.buildDir/path.filename()).generic_string(), target).c_str());
} else {
fileMutex.unlock();
}