From 7410dfe0ff6196e77856a79b4c92b05a90e35880 Mon Sep 17 00:00:00 2001 From: Brett Date: Thu, 5 Sep 2024 17:18:30 -0400 Subject: [PATCH] replaced format file --- CMakeLists.txt | 12 ++++++++++-- include/blt/{std => format}/format.h | 2 +- include/blt/fs/nbt.h | 2 +- libraries/parallel-hashmap | 2 +- src/blt/{std => format}/format.cpp | 2 +- src/blt/profiling/profiler.cpp | 2 +- src/blt/profiling/profiler_v2.cpp | 2 +- 7 files changed, 16 insertions(+), 8 deletions(-) rename include/blt/{std => format}/format.h (99%) rename src/blt/{std => format}/format.cpp (99%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 81bca4d..b0e2c8d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.20) include(cmake/color.cmake) -set(BLT_VERSION 0.19.7) +set(BLT_VERSION 0.20.0) set(BLT_TEST_VERSION 0.0.1) set(BLT_TARGET BLT) @@ -17,6 +17,7 @@ option(BUILD_STD "Build the BLT standard utilities." ON) option(BUILD_PROFILING "Build the BLT profiler extension" ON) option(BUILD_FS "Build the BLT FS utilities including the NBT + eNBT extension" ON) option(BUILD_PARSE "Build the BLT parsers" ON) +option(BUILD_FORMAT "Build the BLT formatters" ON) option(BUILD_TESTS "Build the BLT test set" OFF) @@ -64,6 +65,13 @@ else () set(PARSE_FILES "") endif () +if (${BUILD_FORMAT}) + message(STATUS "Building ${Yellow}format${ColourReset} cxx files") + file(GLOB_RECURSE FORMAT_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/blt/format/*.cpp") +else () + set(FORMAT_FILES "") +endif () + if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/libraries/parallel-hashmap) message("Found Parallel Hashmaps library, using ${Yellow}phmap${ColourReset} over ${Red}std::unordered_map${ColourReset}") include_directories(${CMAKE_CURRENT_SOURCE_DIR}/libraries/parallel-hashmap) @@ -83,7 +91,7 @@ endif () include_directories(include/) include_directories(${CMAKE_CURRENT_BINARY_DIR}/config/) -add_library(${BLT_TARGET} ${STD_FILES} ${PROFILING_FILES} ${FS_FILES} ${PARSE_FILES}) +add_library(${BLT_TARGET} ${STD_FILES} ${PROFILING_FILES} ${FS_FILES} ${PARSE_FILES} ${FORMAT_FILES}) string(REPLACE "+" "\\+" escaped_source ${CMAKE_CURRENT_SOURCE_DIR}) string(APPEND escaped_source "/src/blt/.*/") diff --git a/include/blt/std/format.h b/include/blt/format/format.h similarity index 99% rename from include/blt/std/format.h rename to include/blt/format/format.h index 1b8ec60..4b5aee9 100644 --- a/include/blt/std/format.h +++ b/include/blt/format/format.h @@ -15,7 +15,7 @@ #include #include #include "memory.h" -#include "vector.h" +#include #include namespace blt::string diff --git a/include/blt/fs/nbt.h b/include/blt/fs/nbt.h index eb9941c..0a04535 100644 --- a/include/blt/fs/nbt.h +++ b/include/blt/fs/nbt.h @@ -13,7 +13,7 @@ #include #include -#include "blt/std/format.h" +#include "blt/format/format.h" #include "blt/fs/filesystem.h" #include "blt/std/logging.h" #include "blt/std/memory.h" diff --git a/libraries/parallel-hashmap b/libraries/parallel-hashmap index d88c5e1..8a889d3 160000 --- a/libraries/parallel-hashmap +++ b/libraries/parallel-hashmap @@ -1 +1 @@ -Subproject commit d88c5e15079047777b418132ece5879e7c9aaa2b +Subproject commit 8a889d3699b3c09ade435641fb034427f3fd12b6 diff --git a/src/blt/std/format.cpp b/src/blt/format/format.cpp similarity index 99% rename from src/blt/std/format.cpp rename to src/blt/format/format.cpp index 2bfab06..3d79234 100644 --- a/src/blt/std/format.cpp +++ b/src/blt/format/format.cpp @@ -3,7 +3,7 @@ * Licensed under GNU General Public License V3.0 * See LICENSE file for license detail */ -#include +#include #include #include #include "blt/std/logging.h" diff --git a/src/blt/profiling/profiler.cpp b/src/blt/profiling/profiler.cpp index 2a684ef..b088016 100644 --- a/src/blt/profiling/profiler.cpp +++ b/src/blt/profiling/profiler.cpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include #define TIME_FUNCTION blt::system::getCPUThreadTime() diff --git a/src/blt/profiling/profiler_v2.cpp b/src/blt/profiling/profiler_v2.cpp index eb45b58..593fd2e 100644 --- a/src/blt/profiling/profiler_v2.cpp +++ b/src/blt/profiling/profiler_v2.cpp @@ -6,7 +6,7 @@ #include #include #include -#include +#include #include #include #include