Browse Source

Added Project::Rust::compile()

merge-requests/365/head
eidheim 8 years ago
parent
commit
e8fa0545ae
  1. 8
      src/project.cc
  2. 1
      src/project.h

8
src/project.cc

@ -768,6 +768,14 @@ void Project::HTML::compile_and_run() {
#endif #endif
} }
void Project::Rust::compile() {
std::string command=build->get_compile_command();
Terminal::get().print("Running "+command+"\n");
Terminal::get().async_process(command, Notebook::get().get_current_view()->file_path.parent_path(), [command](int exit_status) {
Terminal::get().async_print(command+" returned: "+std::to_string(exit_status)+'\n');
});
}
void Project::Rust::compile_and_run() { void Project::Rust::compile_and_run() {
std::string command="cargo run"; std::string command="cargo run";
Terminal::get().print("Running "+command+"\n"); Terminal::get().print("Running "+command+"\n");

1
src/project.h

@ -147,6 +147,7 @@ namespace Project {
public: public:
Rust(std::unique_ptr<Build> &&build) : LLDB(std::move(build)) {} Rust(std::unique_ptr<Build> &&build) : LLDB(std::move(build)) {}
void compile() override;
void compile_and_run() override; void compile_and_run() override;
}; };

Loading…
Cancel
Save