summaryrefslogtreecommitdiffhomepage
path: root/include/NeBuildKit/Detail
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-12-31 11:17:44 +0100
committerAmlal El Mahrouss <amlal@nekernel.org>2025-12-31 11:19:11 +0100
commit635401b6a71dd7466604f25a1591ba324125d133 (patch)
tree2d51ffac16fcd51504982446f8aaa3dd11babbd1 /include/NeBuildKit/Detail
parentdcb52140c062e5cb7fafe04b292a0f98dd6be97d (diff)
feat: codebase improvements introduce 'b_internal' keyword for SDK code.v0.1.1v0.1.1-develop
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'include/NeBuildKit/Detail')
-rw-r--r--include/NeBuildKit/Detail/Config.h29
1 files changed, 23 insertions, 6 deletions
diff --git a/include/NeBuildKit/Detail/Config.h b/include/NeBuildKit/Detail/Config.h
index 22e144f..7bc25fc 100644
--- a/include/NeBuildKit/Detail/Config.h
+++ b/include/NeBuildKit/Detail/Config.h
@@ -13,9 +13,6 @@
#include <cassert>
#include <iostream>
-#define LIKELY(ARG) ((ARG) ? assert(false) : ((void) 0))
-#define UNLIKELY(ARG) LIKELY(!(ARG))
-
#define NEBUILD_VERSION "v0.0.8-buildkit"
#define NEBUILD_VERSION_BCD 0x0007
@@ -28,21 +25,41 @@
#define NEBUILD_UNUSED(X) ((void) X)
+#define b_internal private
+
+#ifdef NEBUILD_INTERNAL_SDK
+#undef b_internal
+#define b_internal public
+#endif
+
namespace NeBuild {
struct BuildConfig final {
- bool has_failed_{false};
- bool dry_run_{false};
- std::string path_{};
+ b_internal:
+ bool has_failed_{false};
+ bool dry_run_{false};
+ std::string path_{};
+ public:
explicit operator bool() { return has_failed_; }
+ bool dry_run() { return dry_run_; }
+ void dry_run(const bool dr) { dry_run_ = dr; }
+
+ bool has_failed() { return has_failed_; }
+ void has_failed(const bool dr) { has_failed_ = dr; }
+
+ const std::string& path() { return path_; }
+ void path(const std::string& pat) { path_ = pat; }
+
BuildConfig() = default;
~BuildConfig() = default;
};
} // namespace NeBuild
+/// \brief Logger namespace.
namespace NeBuild::Logger {
/// @brief replacement for std::cout for NeBuild logging.
+/// @todo change this to spdlog?
inline std::ostream& info() noexcept {
auto& out = std::cout;
out << rang::fg::red << "nebuild: " << rang::style::reset;