Skip to content

Commit

Permalink
build: down grade some dependencies
Browse files Browse the repository at this point in the history
Signed-off-by: black-desk <[email protected]>
  • Loading branch information
black-desk committed Mar 24, 2024
1 parent 46e4768 commit 2f7c466
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 13 deletions.
13 changes: 6 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
5 changes: 2 additions & 3 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}
}
Expand Down
1 change: 0 additions & 1 deletion examples/parse-config/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <string_view>

#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

Expand Down
1 change: 0 additions & 1 deletion examples/using-crun/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include <vector>

#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"
Expand Down
5 changes: 4 additions & 1 deletion src/ocppi/cli/CommonCLI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include <vector>

#include "nlohmann/json.hpp"
#include "nlohmann/json_fwd.hpp"
#include "ocppi/cli/CommandFailedError.hpp"
#include "ocppi/cli/ExecutableNotFoundError.hpp"
#include "ocppi/cli/Process.hpp"
Expand All @@ -34,7 +33,11 @@
#ifdef OCPPI_WITH_SPDLOG
#include <memory>

#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"

Expand Down

0 comments on commit 2f7c466

Please sign in to comment.