diff --git a/CMakeLists.txt b/CMakeLists.txt index e61b8b4..bc058da 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,27 +37,26 @@ if(NOT TARGET tl::expected) endif() list(APPEND OCPPI_LINK_LIBRARIES PUBLIC tl::expected) -set(OCPPI_JSON_MINIMAL_VERSION 3.11.2) +set(OCPPI_JSON_MINIMAL_VERSION 3.5.0) # debian buster CPMFindPackage( NAME nlohmann_json VERSION "${OCPPI_JSON_MINIMAL_VERSION}" - URL "https://github.com/nlohmann/json/releases/download/v3.11.3/json.tar.xz" + URL "https://github.com/nlohmann/json/archive/refs/tags/v3.5.0.tar.gz" EXCLUDE_FROM_ALL ON) list(APPEND OCPPI_LINK_LIBRARIES PUBLIC nlohmann_json::nlohmann_json) -set(OCPPI_SPDLOG_MINIMAL_VERSION 1.10.0) +set(OCPPI_SPDLOG_MINIMAL_VERSION 1.3.1) # debian buster if(OCPPI_WITH_SPDLOG) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DOCPPI_WITH_SPDLOG") CPMFindPackage( NAME spdlog VERSION ${OCPPI_SPDLOG_MINIMAL_VERSION} GITHUB_REPOSITORY "gabime/spdlog" - GIT_TAG "v1.13.0" + GIT_TAG "v1.3.1" GIT_SHALLOW ON EXCLUDE_FROM_ALL ON - OPTIONS - "CMAKE_POSITION_INDEPENDENT_CODE ON" # NOTE: - # https://github.com/gabime/spdlog/issues/1190 + OPTIONS "CMAKE_POSITION_INDEPENDENT_CODE ON" # NOTE: + # https://github.com/gabime/spdlog/issues/1190 ) list(APPEND OCPPI_LINK_LIBRARIES PRIVATE spdlog::spdlog) endif() diff --git a/CMakePresets.json b/CMakePresets.json index f493997..6f7c6bd 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -10,9 +10,10 @@ "name": "debug", "displayName": "Debug configuration", "description": "Configure ocppi for development and debugging.", - "binaryDir": "${sourceDir}/build-debug", + "binaryDir": "${sourceDir}/build", "cacheVariables": { "CPM_DOWNLOAD_ALL": true, + "OCPPI_WITH_SPDLOG": true, "CMAKE_CXX_FLAGS": "-Wall -Wextra -Wpedantic -Og -g -fsanitize=address,undefined", "CMAKE_EXPORT_COMPILE_COMMANDS": true, "CMAKE_COLOR_DIAGNOSTICS": true @@ -35,8 +36,6 @@ "description": "Configure ocppi with spdlog for CI.", "binaryDir": "${sourceDir}/build-ci-with-spdlog", "cacheVariables": { - "CPM_LOCAL_PACKAGES_ONLY": true, - "CMAKE_BUILD_TYPE": "Release", "OCPPI_WITH_SPDLOG": true } } diff --git a/examples/parse-config/src/main.cpp b/examples/parse-config/src/main.cpp index 2f7bb13..2cf27d3 100644 --- a/examples/parse-config/src/main.cpp +++ b/examples/parse-config/src/main.cpp @@ -5,7 +5,6 @@ #include #include "nlohmann/json.hpp" -#include "nlohmann/json_fwd.hpp" #include "ocppi/runtime/config/types/Config.hpp" #include "ocppi/runtime/config/types/Generators.hpp" // IWYU pragma: keep diff --git a/examples/using-crun/src/main.cpp b/examples/using-crun/src/main.cpp index 073adb5..7248aa2 100644 --- a/examples/using-crun/src/main.cpp +++ b/examples/using-crun/src/main.cpp @@ -9,7 +9,6 @@ #include #include "nlohmann/json.hpp" -#include "nlohmann/json_fwd.hpp" #include "ocppi/cli/CLI.hpp" #include "ocppi/cli/crun/Crun.hpp" #include "ocppi/runtime/Signal.hpp" diff --git a/src/ocppi/cli/CommonCLI.cpp b/src/ocppi/cli/CommonCLI.cpp index ba2995b..4fc4ce9 100644 --- a/src/ocppi/cli/CommonCLI.cpp +++ b/src/ocppi/cli/CommonCLI.cpp @@ -9,7 +9,6 @@ #include #include "nlohmann/json.hpp" -#include "nlohmann/json_fwd.hpp" #include "ocppi/cli/CommandFailedError.hpp" #include "ocppi/cli/ExecutableNotFoundError.hpp" #include "ocppi/cli/Process.hpp" @@ -34,7 +33,11 @@ #ifdef OCPPI_WITH_SPDLOG #include +#if __has_include("spdlog/fmt/ranges.h") #include "spdlog/fmt/ranges.h" // IWYU pragma: keep +#else +#include "spdlog/fmt/bundled/ranges.h" // IWYU pragma: keep +#endif #include "spdlog/sinks/null_sink.h" #include "spdlog/spdlog.h"