This commit is contained in:
parent
f0548165b9
commit
0efce16d3c
1 changed files with 22 additions and 25 deletions
|
|
@ -69,36 +69,33 @@ int main(int argc, char* argv[]) {
|
|||
Project project(std::move(projectPath));
|
||||
|
||||
if(command == "build") {
|
||||
std::tuple<Configuration&, BuildResult> config;
|
||||
|
||||
std::tuple<Configuration&, BuildResult> 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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue