diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-10-29 12:05:32 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-10-29 12:05:32 +0100 |
| commit | 1350d6381de4c2b2c56a69f0dc20ce54fab7be8b (patch) | |
| tree | 504c6c1274494d912535b394f1890ccf9dfc4235 | |
| parent | 11ea29334a52ef33dbd04b1f320c033ebf31f37b (diff) | |
feat: new NeBuild JSON API.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
| -rw-r--r-- | dev/src/JSONManifestBuilder.cc | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/dev/src/JSONManifestBuilder.cc b/dev/src/JSONManifestBuilder.cc index 5ea96a7..e045f6c 100644 --- a/dev/src/JSONManifestBuilder.cc +++ b/dev/src/JSONManifestBuilder.cc @@ -49,8 +49,8 @@ bool JSONManifestBuilder::BuildTarget(const std::string& argv_val, const bool dr std::string compiler = json_obj["compiler_path"].get<std::string>(); if (compiler != "g++" || !compiler.starts_with("clang")) { - NeBuild::Logger::info() << "nebuild: error: compiler '" << compiler << "' is not a valid C/C++ compiler!" - << std::endl; + NeBuild::Logger::info() << "nebuild: error: compiler '" << compiler + << "' is not a valid C/C++ compiler!" << std::endl; return false; } @@ -62,8 +62,8 @@ bool JSONManifestBuilder::BuildTarget(const std::string& argv_val, const bool dr command += "-I" + headers.get<std::string>() + " "; } - JSON headers_path = json_obj["headers_path"]; - JSON sources_files = json_obj["sources_path"]; + JSON headers_path = json_obj["headers_path"]; + JSON sources_files = json_obj["sources_path"]; for (auto& sources : sources_files) { command += sources.get<std::string>() + " "; @@ -127,8 +127,6 @@ bool JSONManifestBuilder::BuildTarget(const std::string& argv_val, const bool dr #endif return false; - } else { - return false; } #if defined(NEBUILD_WINDOWS) @@ -137,12 +135,12 @@ bool JSONManifestBuilder::BuildTarget(const std::string& argv_val, const bool dr std::system(("./" + target).c_str()); #endif } - } catch (...) { - return true; + } catch (std::runtime_error& err) { + NeBuild::Logger::info() << "error: " << err.what() << std::endl; + return false; } } catch (std::runtime_error& err) { NeBuild::Logger::info() << "error: " << err.what() << std::endl; - return false; } |
