|
|
|
|
@ -178,21 +178,6 @@ std::unique_ptr<CMake> Window::get_cmake() {
|
|
|
|
|
return std::unique_ptr<CMake>(new CMake(path)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void Window::escape_executable(std::string &executable) { |
|
|
|
|
bool backslash=false; |
|
|
|
|
for(auto it=executable.begin();it!=executable.end();) { |
|
|
|
|
if(*it=='\\' && !backslash) |
|
|
|
|
backslash=true; |
|
|
|
|
else if(backslash) |
|
|
|
|
backslash=false; |
|
|
|
|
else if(*it==' ') { |
|
|
|
|
it=executable.insert(it, '\\'); |
|
|
|
|
it++; |
|
|
|
|
} |
|
|
|
|
it++; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void Window::configure() { |
|
|
|
|
Config::get().load(); |
|
|
|
|
auto style_context = Gtk::StyleContext::create(); |
|
|
|
|
@ -604,10 +589,11 @@ void Window::set_menu_actions() {
|
|
|
|
|
size_t pos=executable.find(project_path.string()); |
|
|
|
|
if(pos!=std::string::npos) |
|
|
|
|
executable.replace(pos, project_path.string().size(), default_build_path.string()); |
|
|
|
|
escape_executable(executable); |
|
|
|
|
} |
|
|
|
|
run_arguments=executable; |
|
|
|
|
run_arguments=filesystem::escape(executable); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
run_arguments=cmake.project_path.string(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
entry_box.clear(); |
|
|
|
|
@ -663,7 +649,7 @@ void Window::set_menu_actions() {
|
|
|
|
|
size_t pos=command.find(project_path.string()); |
|
|
|
|
if(pos!=std::string::npos) |
|
|
|
|
command.replace(pos, project_path.string().size(), default_build_path.string()); |
|
|
|
|
escape_executable(command); |
|
|
|
|
command=filesystem::escape(command); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
compiling=true; |
|
|
|
|
@ -775,7 +761,7 @@ void Window::set_menu_actions() {
|
|
|
|
|
size_t pos=command.find(project_path.string()); |
|
|
|
|
if(pos!=std::string::npos) |
|
|
|
|
command.replace(pos, project_path.string().size(), debug_build_path.string()); |
|
|
|
|
escape_executable(command); |
|
|
|
|
command=filesystem::escape(command); |
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
auto breakpoints=std::make_shared<std::vector<std::pair<boost::filesystem::path, int> > >(); |
|
|
|
|
@ -796,7 +782,7 @@ void Window::set_menu_actions() {
|
|
|
|
|
if(exit_status!=EXIT_SUCCESS) |
|
|
|
|
debugging=false; |
|
|
|
|
else { |
|
|
|
|
Debug::get().start(breakpoints, command, debug_build_path, [this, command](int exit_status){ |
|
|
|
|
Debug::get().start(breakpoints, filesystem::unescape(command), debug_build_path, [this, command](int exit_status){ |
|
|
|
|
debugging=false; |
|
|
|
|
Terminal::get().async_print(command+" returned: "+std::to_string(exit_status)+'\n'); |
|
|
|
|
}, [this](const std::string &status) { |
|
|
|
|
|