diff --git a/implementations/main.cpp b/implementations/main.cpp index fcfcb51..314e14f 100644 --- a/implementations/main.cpp +++ b/implementations/main.cpp @@ -72,12 +72,21 @@ int main(int argc, char* argv[]) { std::tuple config = project.Build(argument); 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).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()); + 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 {} && ./{}", (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 {