summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt5
-rw-r--r--README.md1
-rw-r--r--src/lib/JSONManifestBuilder.cc21
3 files changed, 15 insertions, 12 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c4af61e..01284a9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,3 +1,8 @@
+# // ============================================================= //
+# // nebuild
+# // Copyright (C) 2025, Amlal El Mahrouss, licensed under BSD-3 license.
+# // ============================================================= //
+
cmake_minimum_required(VERSION 3.16)
project(nebuild VERSION 0.1 LANGUAGES CXX)
diff --git a/README.md b/README.md
index 0a3eb57..02a792c 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,5 @@
# NeBuild
-![CI](https://github.com/nekernel-org/nebuild/actions/workflows/c-cpp.yml/badge.svg)
![CI](https://github.com/nekernel-org/nebuild/actions/workflows/c-cpp-dev.yml/badge.svg)
[![License: GPL-3.0](https://img.shields.io/badge/license-BSD--3.0-blue.svg)](LICENSE)
diff --git a/src/lib/JSONManifestBuilder.cc b/src/lib/JSONManifestBuilder.cc
index af69176..5bd89c6 100644
--- a/src/lib/JSONManifestBuilder.cc
+++ b/src/lib/JSONManifestBuilder.cc
@@ -8,13 +8,12 @@
#include <fstream>
namespace NeBuild {
-using JSON = nlohmann::json;
namespace FS = std::filesystem;
/// =========================================================== ///
-/// @brief Builds a JSON target from a JSON file.
+/// @brief Builds a nlohmann::json target from a nlohmann::json file.
/// @param arg_sz filename size (must be 1 or greater).
-/// @param arg_val filename path (must be a valid JSON file).
+/// @param arg_val filename path (must be a valid nlohmann::json file).
/// @retval true building has succeeded.
/// @retval false fail to build, see error message.
/// =========================================================== ///
@@ -38,42 +37,42 @@ bool JSONManifestBuilder::BuildTarget(BuildConfig& config) {
std::ifstream json(path);
if (!json.good()) {
- NeBuild::Logger::info() << "nebuild: error: file '" << path << "' is not a valid JSON"
+ NeBuild::Logger::info() << "nebuild: error: file '" << path << "' is not a valid nlohmann::json"
<< std::endl;
return false;
}
- JSON json_obj = JSON::parse(json);
+ nlohmann::json json_obj = nlohmann::json::parse(json);
std::string compiler = json_obj["compiler_path"].get<std::string>();
std::string command = compiler + " ";
- JSON header_search_path = json_obj["compiler_headers_path"];
+ nlohmann::json header_search_path = json_obj["compiler_headers_path"];
for (auto& headers : header_search_path) {
command += "-I" + headers.get<std::string>() + " ";
}
- JSON headers_path = json_obj["headers_path"];
+ nlohmann::json headers_path = json_obj["headers_path"];
for (auto& headers : headers_path) {
command += "-I" + headers.get<std::string>() + " ";
}
- JSON sources_files = json_obj["sources_path"];
+ nlohmann::json sources_files = json_obj["sources_path"];
for (auto& sources : sources_files) {
command += sources.get<std::string>() + " ";
}
- JSON macros_list = json_obj["cpp_macros"];
+ nlohmann::json macros_list = json_obj["cpp_macros"];
for (auto& macro : macros_list) {
command += "-D" + macro.get<std::string>() + " ";
}
- JSON compiler_flags = json_obj["compiler_flags"];
+ nlohmann::json compiler_flags = json_obj["compiler_flags"];
for (auto& flag : compiler_flags) {
command += flag.get<std::string>() + " ";
@@ -109,6 +108,6 @@ bool JSONManifestBuilder::BuildTarget(BuildConfig& config) {
/// @brief Returns the build system name.
/// =========================================================== ///
const std::string_view JSONManifestBuilder::BuildSystem() {
- return "NeBuild (JSON)";
+ return "NeBuild (nlohmann::json)";
}
} // namespace NeBuild \ No newline at end of file