From 0efce16d3c522eea4e22781e12f39dd67ab173c2 Mon Sep 17 00:00:00 2001 From: Jorijn van der Graaf Date: Sun, 1 Mar 2026 15:55:02 +0100 Subject: [PATCH] windows build fixes --- implementations/main.cpp | 47 +++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 25 deletions(-) diff --git a/implementations/main.cpp b/implementations/main.cpp index 9d53ad5..c351d1e 100644 --- a/implementations/main.cpp +++ b/implementations/main.cpp @@ -69,36 +69,33 @@ int main(int argc, char* argv[]) { Project project(std::move(projectPath)); if(command == "build") { - std::tuple config; - + std::tuple config = project.Build(argument); try { - config = project.Build(argument); - } catch(std::exception& e) { - std::cout << e.what() << std::endl; - } - - if(std::get<1>(config).errors.empty()) { - if(run){ - std::string binDir = std::format("{}/{}", project.binDir.string(), std::get<0>(config).name); - if(std::get<0>(config).target == "x86_64-w64-mingw32") { - if(std::get<0>(config).debug) { - system(std::format("cd {} && wine ./{}.exe", (project.path.parent_path()/binDir).string(), project.name).c_str()); - //system(std::format("cd {} && lldb -o run {}", (fs::path(projectPath).parent_path()/binDir).string(), project.name).c_str()); + if(std::get<1>(config).errors.empty()) { + if(run){ + std::string binDir = std::format("{}/{}", project.binDir.string(), std::get<0>(config).name); + if(std::get<0>(config).target == "x86_64-w64-mingw32") { + if(std::get<0>(config).debug) { + system(std::format("cd {} && wine ./{}.exe", (project.path.parent_path()/binDir).string(), project.name).c_str()); + //system(std::format("cd {} && lldb -o run {}", (fs::path(projectPath).parent_path()/binDir).string(), project.name).c_str()); + } else { + system(std::format("cd {} && wine ./{}.exe", (project.path.parent_path()/binDir).string(), project.name).c_str()); + } } else { - system(std::format("cd {} && wine ./{}.exe", (project.path.parent_path()/binDir).string(), project.name).c_str()); - } - } else { - if(std::get<0>(config).debug) { - system(std::format("cd {} && ./{}", (project.path.parent_path()/binDir).string(), project.name).c_str()); - //system(std::format("cd {} && lldb -o run {}", (fs::path(projectPath).parent_path()/binDir).string(), project.name).c_str()); - } else { - system(std::format("cd {} && ./{}", (project.path.parent_path()/binDir).string(), project.name).c_str()); + if(std::get<0>(config).debug) { + system(std::format("cd {} && ./{}", (project.path.parent_path()/binDir).string(), project.name).c_str()); + //system(std::format("cd {} && lldb -o run {}", (fs::path(projectPath).parent_path()/binDir).string(), project.name).c_str()); + } else { + system(std::format("cd {} && ./{}", (project.path.parent_path()/binDir).string(), project.name).c_str()); + } } } + } else { + std::cout << std::get<1>(config).errors << std::endl; + return 1; } - } else { - std::cout << std::get<1>(config).errors << std::endl; - return 1; + } catch(std::exception& e) { + std::cout << e.what() << std::endl; } } else if(command == "test") { bool anyFailed = false;