diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-12-04 12:32:06 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-12-04 12:32:06 +0100 |
| commit | 4b74af25b0f36175f3a494e6cfa79893f0b8613f (patch) | |
| tree | e82fa310862d515171667d6a32ef87575e630c1e /include/NeBuildKit/Detail/Config.h | |
| parent | 4aff18372f1e5a3e12a3c220c18f338f313da8c6 (diff) | |
chore: Move Config.h to Detail/
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'include/NeBuildKit/Detail/Config.h')
| -rw-r--r-- | include/NeBuildKit/Detail/Config.h | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/include/NeBuildKit/Detail/Config.h b/include/NeBuildKit/Detail/Config.h new file mode 100644 index 0000000..915bde4 --- /dev/null +++ b/include/NeBuildKit/Detail/Config.h @@ -0,0 +1,55 @@ +// ============================================================= // +// nebuild +// Copyright (C) 2024-2025, Amlal El Mahrouss, licensed under BSD-3 license. +// ============================================================= // + +#pragma once + +/// =========================================================== /// +/// @author Amlal El Mahrouss +/// =========================================================== /// + +#include <rang/rang.h> +#include <cassert> +#include <iostream> + +#define LIKELY(ARG) ((ARG) ? assert(false) : ((void) 0)) +#define UNLIKELY(ARG) LIKELY(!(ARG)) + +#define LIBNEBUILD_VERSION "v0.0.7-buildkit" + +#define LIBNEBUILD_VERSION_BCD 0x0007 + +#define LIBNEBUILD_VERSION_MAJOR 0 +#define LIBNEBUILD_VERSION_MINOR 0 +#define LIBNEBUILD_VERSION_PATCH 7 + +#define LIBNEBUILD_EXPORT_C extern "C" + +#define LIBNEBUILD_UNUSED(X) ((void) X) + +namespace NeBuild { + struct BuildConfig final { + bool has_failed_{false}; + bool dry_run_{false}; + std::string path_{}; + + explicit operator bool() { + return has_failed_; + } + + BuildConfig() = default; + ~BuildConfig() {} + }; +} + +namespace NeBuild::Logger { +/// @brief replacement for std::cout for NeBuild logging. +inline std::ostream& info() noexcept { + auto& out = std::cout; + out << rang::fg::red << "nebuild: " << rang::style::reset; + return out; +} +} // namespace NeBuild::Logger + + |
