Merge cmkrlib into the cmkr target

This commit is contained in:
Duncan Ogilvie
2021-05-03 17:10:06 +02:00
parent 6d9b40bd15
commit 6395267e4b
20 changed files with 50 additions and 108 deletions
+24
View File
@@ -0,0 +1,24 @@
#include "error.hpp"
#include <assert.h>
namespace cmkr {
namespace error {
Status::Status(Code ec) noexcept : ec_(ec) {}
Status::operator int() const noexcept { return static_cast<int>(ec_); }
Status::Code Status::code() const noexcept { return ec_; }
} // namespace error
} // namespace cmkr
const char *err_string[] = {
"Success", "Runtime error", "Initialization error", "CMake generation error", "Build error",
};
const char *cmkr_error_status(int i) {
assert(i >= 0 && i < 5);
return err_string[i];
}