- Regex: '^<ccache/'
Priority: 2
# Dependency headers:
- - Regex: '^<(doctest/.*|fmt/.*|hiredis/.*|httplib\.h|nonstd/.*|zstd\.h)>$'
+ - Regex: '^<(doctest/.*|fmt/.*|hiredis/.*|httplib\.h|nonstd/.*|tl/expected\.hpp|zstd\.h)>$'
Priority: 3
# System headers:
- Regex: '\.h.*>$'
----
-=== src/third_party/tl/expected.hpp
+=== src/third_party/tl-expected/tl/expected.hpp
This is https://github.com/TartanLlama/expected[TartanLlama expected] 1.1.0 with
the following license:
find_package(CppHttplib 0.10.6 MODULE REQUIRED)
find_package(Fmt 8.0.0 MODULE REQUIRED)
find_package(NonstdSpan 0.10.3 MODULE REQUIRED)
+find_package(TlExpected 1.1.0 MODULE REQUIRED)
find_package(Zstd 1.3.4 MODULE REQUIRED)
if(ENABLE_TESTING)
--- /dev/null
+mark_as_advanced(TLEXPECTED_INCLUDE_DIR)
+
+if(DEP_TLEXPECTED STREQUAL "BUNDLED")
+ message(STATUS "Using bundled TlExpected as requested")
+else()
+ find_path(TLEXPECTED_INCLUDE_DIR tl/expected.hpp)
+ if(TLEXPECTED_INCLUDE_DIR)
+ file(READ "${TLEXPECTED_INCLUDE_DIR}/tl/expected.hpp" _tlexpected_h)
+ string(REGEX MATCH "#define TL_EXPECTED_VERSION_MAJOR ([0-9]+).*#define TL_EXPECTED_VERSION_MINOR ([0-9]+).*#define TL_EXPECTED_VERSION_PATCH ([0-9]+)" _ "${_tlexpected_h}")
+ set(_tlexpected_version_string "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}.${CMAKE_MATCH_3}")
+ if(NOT "${CMAKE_MATCH_0}" STREQUAL "" AND "${_tlexpected_version_string}" VERSION_GREATER_EQUAL "${TlExpected_FIND_VERSION}")
+ message(STATUS "Using system TlExpected (${TLEXPECTED_INCLUDE_DIR}/tl/expected.hpp)")
+ add_library(dep_tlexpected INTERFACE IMPORTED)
+ target_include_directories(dep_tlexpected INTERFACE "${TLEXPECTED_INCLUDE_DIR}")
+ register_dependency(TlExpected "SYSTEM (${TLEXPECTED_INCLUDE_DIR}/tl/expected.hpp)" "${_tlexpected_version_string}")
+ endif()
+ endif()
+ if(NOT TARGET dep_tlexpected)
+ message(STATUS "Using bundled TlExpected since TlExpected>=${TlExpected_FIND_VERSION} was not found locally")
+ endif()
+endif()
- [hiredis](https://github.com/redis/hiredis)[^2] (optional, disable with `-D
REDIS_STORAGE_BACKEND=OFF`)
- [span-lite](https://github.com/martinmoene/span-lite)[^1]
+- [tl-expected](https://github.com/TartanLlama/expected)[^1]
- [Zstandard](https://github.com/facebook/zstd)[^2]
[^1]: A bundled version will be used if missing locally.
PUBLIC
dep_fmt
dep_nonstdspan
+ dep_tlexpected
third_party
PRIVATE
dep_cpphttplib
#pragma once
#include <nonstd/span.hpp>
+#include <tl/expected.hpp>
#include <blake3/blake3.h>
-#include <tl/expected.hpp>
#include <array>
#include <cstdint>
#include <ccache/util/Bytes.hpp>
#include <nonstd/span.hpp>
-
#include <tl/expected.hpp>
+
#include <url.hpp>
#include <chrono>
#include <ccache/util/types.hpp>
#include <nonstd/span.hpp>
-
#include <tl/expected.hpp>
#include <cstddef>
#include <ccache/util/conversion.hpp>
#include <nonstd/span.hpp>
+#include <tl/expected.hpp>
#include <sys/stat.h> // for mode_t
-#include <tl/expected.hpp>
#include <cstdint>
#include <cstring>
#include <ccache/util/Bytes.hpp>
#include <nonstd/span.hpp>
-
#include <tl/expected.hpp>
#include <cstddef>
if(NOT TARGET dep_nonstdspan)
add_subdirectory(nonstd-span)
endif()
+if(NOT TARGET dep_tlexpected)
+ add_subdirectory(tl-expected)
+endif()
--- /dev/null
+register_dependency(TlExpected BUNDLED 1.1.0)
+add_header_only_library(tlexpected DIR "${CMAKE_CURRENT_SOURCE_DIR}")
#include <ccache/util/expected.hpp>
#include <doctest/doctest.h>
-
#include <tl/expected.hpp>
#include <iostream> // macOS bug: https://github.com/onqtam/doctest/issues/126