add missing header

self-hosting
MoAlyousef 4 years ago
parent 4688ba718c
commit 65d03aa50e

@ -8,6 +8,7 @@
#include <stdexcept>
#include <stdlib.h>
#include <string>
#include <system_error>
#include <toml.hpp>
namespace cmkr::build {
@ -53,6 +54,8 @@ int run(int argc, char **argv) {
int cmkr_build_run(int argc, char **argv) {
try {
return cmkr::build::run(argc, argv);
} catch (const std::system_error &e) {
return e.code().value();
} catch (...) {
return cmkr::error::Status(cmkr::error::Status::Code::BuildError);
}

@ -13,7 +13,6 @@
#include <string_view>
#include <toml.hpp>
namespace fs = std::filesystem;
namespace cmkr::gen {
@ -233,6 +232,8 @@ int generate_cmake(const char *path) {
int cmkr_gen_generate_project(const char *typ) {
try {
return cmkr::gen::generate_project(typ);
} catch (const std::system_error &e) {
return e.code().value();
} catch (...) {
return cmkr::error::Status(cmkr::error::Status::Code::InitError);
}
@ -241,6 +242,8 @@ int cmkr_gen_generate_project(const char *typ) {
int cmkr_gen_generate_cmake(const char *path) {
try {
return cmkr::gen::generate_cmake(path);
} catch (const std::system_error &e) {
return e.code().value();
} catch (...) {
return cmkr::error::Status(cmkr::error::Status::Code::GenerationError);
}

Loading…
Cancel
Save