From 0ef6bae1a2d7c8ed98103e24fa831f7d9b520ab7 Mon Sep 17 00:00:00 2001 From: Amlal Date: Wed, 25 Sep 2024 17:35:06 +0200 Subject: WIP: Add initial TOML build support - Set up basic structure for handling TOML files in the build process Signed-off-by: Amlal --- src/IManifestBuilder.cxx | 5 +++++ src/JSONManifestBuilder.cxx | 24 +++++++++--------------- src/TOMLManifestBuilder.cxx | 19 +++++++++++++++++++ 3 files changed, 33 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/IManifestBuilder.cxx b/src/IManifestBuilder.cxx index c1dbe51..7a2f210 100644 --- a/src/IManifestBuilder.cxx +++ b/src/IManifestBuilder.cxx @@ -1 +1,6 @@ +// ============================================================= // +// btb +// Copyright ZKA Technologies. +// ============================================================= // + #include diff --git a/src/JSONManifestBuilder.cxx b/src/JSONManifestBuilder.cxx index d456bb7..b9e186d 100644 --- a/src/JSONManifestBuilder.cxx +++ b/src/JSONManifestBuilder.cxx @@ -1,22 +1,16 @@ -// -// main.cpp +// ============================================================= // // btb -// -// Created by Amlal on 6/20/24. -// +// Copyright ZKA Technologies. +// ============================================================= // #include - #include - #include #include - #include #include -#include -using json = nlohmann::json; +using JSON = nlohmann::json; /// @brief Builds a JSON target. /// @param arg_sz filename size @@ -45,12 +39,12 @@ bool JSONManifestBuilder::Build(int arg_sz, const char* arg_val) return false; } - json buildme = json::parse(json_obj); + JSON buildme = JSON::parse(json_obj); std::string compiler = buildme["compiler_path"].get(); - json headerSearchPath = buildme["headers_path"]; - json sourceFiles = buildme["sources_path"]; + JSON headerSearchPath = buildme["headers_path"]; + JSON sourceFiles = buildme["sources_path"]; std::string cmdLine = compiler + " "; @@ -64,14 +58,14 @@ bool JSONManifestBuilder::Build(int arg_sz, const char* arg_val) cmdLine += "-I" + headers.get() + " "; } - json macrosList = buildme["cpp_macros"]; + JSON macrosList = buildme["cpp_macros"]; for (auto& macro : macrosList) { cmdLine += "-D" + macro.get() + " "; } - json compilerFlags = buildme["compiler_flags"]; + JSON compilerFlags = buildme["compiler_flags"]; for (auto& flag : compilerFlags) { diff --git a/src/TOMLManifestBuilder.cxx b/src/TOMLManifestBuilder.cxx index e69de29..724db52 100644 --- a/src/TOMLManifestBuilder.cxx +++ b/src/TOMLManifestBuilder.cxx @@ -0,0 +1,19 @@ +// ============================================================= // +// btb +// Copyright ZKA Technologies. +// ============================================================= // + +#include +#include +#include + +/// @brief Builds a TOML target. +/// @param arg_sz filename size +/// @param arg_val filename path. +/// @retval true succeeded. +/// @retval false failed. +bool TOMLManifestBuilder::Build(int arg_sz, const char* arg_val) +{ + + return false; +} -- cgit v1.2.3