std.pcm target
Some checks failed
demo.yaml / std.pcm target (push) Failing after 0s

This commit is contained in:
Jorijn van der Graaf 2026-03-01 02:37:02 +01:00
commit dea9b63ed2
2 changed files with 10 additions and 2 deletions

View file

@ -27,6 +27,7 @@ import :Project;
//import :Dependency;
import :Shader;
import :Module;
import :Command;
namespace fs = std::filesystem;
@ -59,6 +60,9 @@ namespace Crafter {
}
if(config.contains("target")) {
target = config["target"].get<std::string>();
} else {
target = RunCommand("clang -print-target-triple");
target.pop_back();
}
if(config.contains("debug")) {
debug = config["debug"].get<bool>();
@ -267,6 +271,10 @@ namespace Crafter {
self[count] = '\0';
const fs::path cacheDir = (fs::path(self).parent_path().parent_path() / "cloneCache").string();
if (!fs::exists(cacheDir)) {
fs::create_directories(cacheDir);
}
if (!fs::exists(cacheDir/depFolder)) {
std::string cloneCommand = std::format("cd {} && git clone {} && cd {}", cacheDir.string(), path.string(), depFolder);

View file

@ -330,7 +330,7 @@ namespace Crafter {
fs::path stdCc = fs::path(std::format("/usr/x86_64-w64-mingw32/include/c++/{}/bits/std.cc", mingWversion));
if(!fs::exists(stdPcm) || fs::last_write_time(stdPcm) < fs::last_write_time(stdCc)) {
std::string result = RunCommand(std::format("cp {} {}/std.cppm\nclang++ --target={} -std=c++26 -Wno-reserved-identifier -Wno-reserved-module-identifier --precompile {}/std.cppm -o {}", stdCc.string(), exeDir.string(), config.target, exeDir.string(), stdPcm));
std::string result = RunCommand(std::format("cp {} {}/{}/std.cppm\nclang++ --target={} -std=c++26 -Wno-reserved-identifier -Wno-reserved-module-identifier --precompile {}/{}/std.cppm -o {}", stdCc.string(), exeDir.string(), config.target, config.target, exeDir.string(), config.target, stdPcm));
if(result != "") {
throw std::runtime_error(result);
}
@ -363,7 +363,7 @@ namespace Crafter {
fs::path stdCc = fs::path(std::format("/usr/include/c++/{}/bits/std.cc", gccVersion));
if(!fs::exists(stdPcm) || fs::last_write_time(stdPcm) < fs::last_write_time(stdCc)) {
std::string result = RunCommand(std::format("cp {} {}/std.cppm\nclang++ --target={} -std=c++26 -Wno-reserved-identifier -Wno-reserved-module-identifier --precompile {}/std.cppm -o {}", config.target, stdCc.string(), exeDir.string(), config.target, exeDir.string(), stdPcm));
std::string result = RunCommand(std::format("cp {} {}/{}/std.cppm\nclang++ --target={} -std=c++26 -Wno-reserved-identifier -Wno-reserved-module-identifier --precompile {}/{}/std.cppm -o {}", stdCc.string(), exeDir.string(), config.target, config.target, exeDir.string(), config.target, stdPcm));
if(result != "") {
throw std::runtime_error(result);
}