Skip to content

Commit 0062294

Browse files
committed
build(deps): add zeus-expected v1.3.3
C++17 std::expected polyfill chosen over tl-expected for strict C++23 alignment, lighter modern codebase, and active LWG fixes. Signed-off-by: Yuming He <ComixHe1895@outlook.com>
1 parent 18442e7 commit 0062294

5 files changed

Lines changed: 2863 additions & 2 deletions

File tree

CMakeLists.txt

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,13 @@ if(linyaps-box_ENABLE_CPM)
284284
GIT_TAG v2.6.2
285285
EXCLUDE_FROM_ALL ON
286286
OPTIONS "CLI11_BUILD_TESTS OFF")
287+
CPMFindPackage(
288+
NAME zeus_expected
289+
VERSION 1.3.3
290+
GITHUB_REPOSITORY zeus-cpp/expected
291+
GIT_TAG v1.3.3
292+
EXCLUDE_FROM_ALL ON
293+
OPTIONS "BUILD_TESTING OFF")
287294
endif()
288295

289296
# find minimal version
@@ -296,7 +303,7 @@ if(NOT nlohmann_json_FOUND)
296303
message(STATUS "use vendor nlohmann_json ${nlohmann_json_VERSION}")
297304
endif()
298305

299-
list(APPEND linyaps-box_LIBRARY_LINK_LIBRARIES PUBLIC
306+
list(APPEND linyaps-box_LIBRARY_LINK_LIBRARIES PRIVATE
300307
nlohmann_json::nlohmann_json)
301308

302309
find_package(CLI11 2.5.0 QUIET)
@@ -308,7 +315,18 @@ if(NOT CLI11_FOUND)
308315
message(STATUS "use vendor CLI11 ${CLI11_VERSION}")
309316
endif()
310317

311-
list(APPEND linyaps-box_LIBRARY_LINK_LIBRARIES PUBLIC CLI11::CLI11)
318+
list(APPEND linyaps-box_LIBRARY_LINK_LIBRARIES PRIVATE CLI11::CLI11)
319+
320+
find_package(zeus_expected 1.3.3 QUIET)
321+
if(NOT zeus_expected_FOUND)
322+
add_subdirectory(external/zeus_expected)
323+
list(APPEND CMAKE_MODULE_PATH
324+
"${CMAKE_CURRENT_SOURCE_DIR}/cmake.external/zeus_expected")
325+
find_package(zeus_expected 1.3.3 REQUIRED)
326+
message(STATUS "use vendor zeus_expected ${zeus_expected_VERSION}")
327+
endif()
328+
329+
list(APPEND linyaps-box_LIBRARY_LINK_LIBRARIES PRIVATE zeus::expected)
312330

313331
add_library("${linyaps-box_LIBRARY}" STATIC ${linyaps-box_LIBRARY_SOURCE})
314332
target_include_directories("${linyaps-box_LIBRARY}"

REUSE.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,9 @@ path = ["external/CLI11/include/**"]
5555
precedence = "aggregate"
5656
SPDX-FileCopyrightText = "2017-2025 University of Cincinnati, developed by Henry Schreiner under NSF AWARD 1414736."
5757
SPDX-License-Identifier = "BSD-3-Clause"
58+
59+
[[annotations]]
60+
path = ["external/zeus_expected/include/**"]
61+
precedence = "aggregate"
62+
SPDX-FileCopyrightText = "2024 zeus-cpp"
63+
SPDX-License-Identifier = "MIT"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
if(TARGET zeus::expected)
2+
set(zeus_expected_FOUND TRUE)
3+
4+
set(zeus_expected_VERSION_MAJOR 1)
5+
set(zeus_expected_VERSION_MINOR 3)
6+
set(zeus_expected_VERSION_PATCH 3)
7+
set(zeus_expected_VERSION "1.3.3")
8+
endif()
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
add_library(zeus_expected INTERFACE)
2+
add_library(zeus::expected ALIAS zeus_expected)
3+
target_include_directories(zeus_expected
4+
INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/include/")

0 commit comments

Comments
 (0)