From 30eeaf6c46057de72d6c2ee3cbee3521cab870fd Mon Sep 17 00:00:00 2001 From: Pavel Solodovnikov Date: Sat, 12 Oct 2024 22:03:25 +0300 Subject: [PATCH] netsocket: provide the shorthand `net::result` for `tl::expected` Plus, add the necessary dependency for the `netplay` library in order for it to find `tl::expected` header files. Signed-off-by: Pavel Solodovnikov --- lib/netplay/CMakeLists.txt | 4 +++- lib/netplay/netsocket.h | 9 +++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/netplay/CMakeLists.txt b/lib/netplay/CMakeLists.txt index 963f4852394..12cb14cb648 100644 --- a/lib/netplay/CMakeLists.txt +++ b/lib/netplay/CMakeLists.txt @@ -57,7 +57,9 @@ add_dependencies(netplay autorevision_netcodeversion) set_property(TARGET netplay PROPERTY FOLDER "lib") include(WZTargetConfiguration) WZ_TARGET_CONFIGURATION(netplay) -target_link_libraries(netplay PRIVATE framework re2::re2 nlohmann_json plum-static Threads::Threads ZLIB::ZLIB) +target_link_libraries(netplay + PRIVATE framework re2::re2 nlohmann_json plum-static Threads::Threads ZLIB::ZLIB + PUBLIC tl::expected) if(WZ_USE_IMPORTED_MINIUPNPC) target_link_libraries(netplay PRIVATE imported-miniupnpc) diff --git a/lib/netplay/netsocket.h b/lib/netplay/netsocket.h index a36c3fcbfb5..1aad4412af6 100644 --- a/lib/netplay/netsocket.h +++ b/lib/netplay/netsocket.h @@ -23,8 +23,17 @@ #include "lib/framework/types.h" #include +#include #include +#include + +namespace net +{ + template + using result = ::tl::expected; +} // namespace net + #if defined(WZ_OS_UNIX) # include # include