diff options
| -rw-r--r-- | CMakeLists.txt | 1 | ||||
| -rw-r--r-- | ReadMe.md | 22 | ||||
| -rw-r--r-- | include/NeBuildKit/Config.h (renamed from include/NeBuildKit/Defines.h) | 26 | ||||
| -rw-r--r-- | include/NeBuildKit/IManifestBuilder.h | 2 | ||||
| -rw-r--r-- | include/NeBuildKit/Imports.h | 23 | ||||
| -rwxr-xr-x | scripts/format.sh (renamed from format.sh) | 0 | ||||
| -rw-r--r-- | src/cli/main.cc | 5 | ||||
| -rw-r--r-- | targets/osx-dylib.json (renamed from osx-dylib.json) | 0 | ||||
| -rw-r--r-- | targets/osx.json (renamed from osx.json) | 0 | ||||
| -rw-r--r-- | targets/posix-dylib.json (renamed from posix-dylib.json) | 0 | ||||
| -rw-r--r-- | targets/posix.json (renamed from posix.json) | 0 | ||||
| -rw-r--r-- | targets/win64.json (renamed from win64.json) | 0 |
12 files changed, 34 insertions, 45 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 7311780..78ab417 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,6 +17,7 @@ add_executable(nebuild ${NEBUILD_SOURCES}) target_include_directories(nebuild PRIVATE ${CMAKE_SOURCE_DIR}/dev ${CMAKE_SOURCE_DIR}/vendor) option(BUILD_WINDOWS "Produce a Windows executable name (nebuild.exe)" OFF) + if(BUILD_WINDOWS) set_target_properties(nebuild PROPERTIES OUTPUT_NAME "nebuild.exe") endif() @@ -10,25 +10,23 @@ ## Guide (GNU Make): -- Run make `build-nebuild-core` and `build-nebuild`. +- Run make `build-nebuild-core` and `build-nebuild` to build from source. ## Guide (NeBuild): -- Run `nebuild` and pass the path to the manifest file. +- Run `nebuild` and pass the path to the manifest file to build from source: -## Guide (CMake): +```sh +nebuild targets/osx.json +``` -```zsh -# out-of-source configure + build (POSIX) -cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -cmake --build build --target nebuild +## Guide (CMake): -# or build the provided custom target -cmake --build build --target build-nebuild +- Use CMake to build `nebuild` from source: -# produce a Windows-style executable name on non-Windows hosts: -cmake -S . -B build -DBUILD_WINDOWS=ON -DCMAKE_BUILD_TYPE=Release -cmake --build build --target nebuild +```zsh +cmake -S . -B build +cmake --build build ``` ###### Copyright (C) 2024-2025, Amlal El Mahrouss and NeKernel.org Authors, licensed under the BSD 3 Clause license. diff --git a/include/NeBuildKit/Defines.h b/include/NeBuildKit/Config.h index 06d936f..00be9de 100644 --- a/include/NeBuildKit/Defines.h +++ b/include/NeBuildKit/Config.h @@ -5,12 +5,20 @@ #pragma once -#include <NeBuildKit/Imports.h> - /// =========================================================== /// -/// @brief Defines file +/// @author Amlal El Mahrouss /// =========================================================== /// +#include <rang/rang.h> +#include <cassert> +#include <cstddef> +#include <cstdio> +#include <fstream> +#include <iostream> +#include <sstream> +#include <string> +#include <thread> + #define LIKELY(ARG) ((ARG) ? assert(false) : ((void) 0)) #define UNLIKELY(ARG) LIKELY(!(ARG)) @@ -18,12 +26,16 @@ #define LIBNEBUILD_VERSION_BCD 0x0007 -#define LIBNEBUILD_VERSION_MAJOR 1 -#define LIBNEBUILD_VERSION_MINOR 1 -#define LIBNEBUILD_VERSION_PATCH 0 +#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 {} + namespace NeBuild::Logger { /// @brief replacement for std::cout for NeBuild logging. inline std::ostream& info() noexcept { @@ -32,3 +44,5 @@ inline std::ostream& info() noexcept { return out; } } // namespace NeBuild::Logger + + diff --git a/include/NeBuildKit/IManifestBuilder.h b/include/NeBuildKit/IManifestBuilder.h index 96c80c3..7d3101c 100644 --- a/include/NeBuildKit/IManifestBuilder.h +++ b/include/NeBuildKit/IManifestBuilder.h @@ -5,7 +5,7 @@ #pragma once -#include <NeBuildKit/Defines.h> +#include <NeBuildKit/Config.h> #define NEBUILD_MANIFEST_BUILDER : public ::NeBuild::IManifestBuilder diff --git a/include/NeBuildKit/Imports.h b/include/NeBuildKit/Imports.h deleted file mode 100644 index 33e1e31..0000000 --- a/include/NeBuildKit/Imports.h +++ /dev/null @@ -1,23 +0,0 @@ -// ============================================================= // -// nebuild -// Copyright (C) 2024-2025, Amlal El Mahrouss, licensed under BSD-3 license. -// ============================================================= // - -#ifndef NEBUILD_INCLUDES_H -#define NEBUILD_INCLUDES_H - -/// =========================================================== /// -/// @brief Imports file -/// =========================================================== /// - -#include <rang/rang.h> -#include <cassert> -#include <cstddef> -#include <cstdio> -#include <fstream> -#include <iostream> -#include <sstream> -#include <string> -#include <thread> - -#endif // NEBUILD_INCLUDES_H diff --git a/format.sh b/scripts/format.sh index f36943c..f36943c 100755 --- a/format.sh +++ b/scripts/format.sh diff --git a/src/cli/main.cc b/src/cli/main.cc index cbce3c0..02889ff 100644 --- a/src/cli/main.cc +++ b/src/cli/main.cc @@ -6,7 +6,6 @@ #include <NeBuildKit/JSONManifestBuilder.h> #include <NeBuildKit/TOMLManifestBuilder.h> -#include "NeBuildKit/Defines.h" static bool kFailed = false; static bool kDryRun = false; @@ -18,9 +17,9 @@ int main(int argc, char** argv) { std::string index_path = argv[index]; if (index_path == "-v" || index_path == "-version") { - NeBuild::Logger::info() << "NeKernel Build.\n"; + NeBuild::Logger::info() << "NeBuild (" << LIBNEBUILD_VERSION << ")\n"; NeBuild::Logger::info() - << "Bugs, Issues? Check out: https://github.com/nekernel-org/nebuild/issues\n"; + << "Bugs, issues? https://github.com/nekernel-org/nebuild/issues\n"; return EXIT_SUCCESS; } else if (index_path == "-dry-run" || index_path == "-n") { diff --git a/osx-dylib.json b/targets/osx-dylib.json index d5b87bc..d5b87bc 100644 --- a/osx-dylib.json +++ b/targets/osx-dylib.json diff --git a/osx.json b/targets/osx.json index bdcab49..bdcab49 100644 --- a/osx.json +++ b/targets/osx.json diff --git a/posix-dylib.json b/targets/posix-dylib.json index 3326b3e..3326b3e 100644 --- a/posix-dylib.json +++ b/targets/posix-dylib.json diff --git a/posix.json b/targets/posix.json index 679296c..679296c 100644 --- a/posix.json +++ b/targets/posix.json diff --git a/win64.json b/targets/win64.json index 75c025a..75c025a 100644 --- a/win64.json +++ b/targets/win64.json |
