added wasm64 support

This commit is contained in:
Jorijn van der Graaf 2024-12-29 03:30:22 +01:00
commit 98a73c0443
2 changed files with 7 additions and 2 deletions

View file

@ -161,13 +161,18 @@ void Project::Build(Configuration config, std::string outputDir) {
pcmDir = config.buildDir;
}
std::string clangDir;
if(config.target == "wasm32-unknown-wasi"){
if(config.target == "wasm32-unknown-wasi" || config.target == "wasm64-unknown-wasi"){
clangDir = "${WASI_SDK_PATH}/bin/clang++ --sysroot=${WASI_SDK_PATH}/share/wasi-sysroot";
name+=".wasm";
} else{
clangDir = "clang++";
}
if(config.target == "wasm32" || config.target == "wasm64") {
clangDir = "${WASI_SDK_PATH}/bin/clang++ --no-standard-libraries -Wl,--no-entry -Wl,--export-all -Wno-unused-command-line-argument";
name+=".wasm";
}
for(const std::string& moduleFile : config.moduleFiles){
system(std::format("{} -std={} {}.cppm --precompile -fprebuilt-module-path={} -o {}/{}.pcm {}", clangDir, config.standard, moduleFile, pcmDir, pcmDir, moduleFile, target).c_str());
}