Skip to content

Commit

Permalink
Adding libfork dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenberry committed Jun 25, 2024
1 parent 7f8ebb3 commit 418abc8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
5 changes: 5 additions & 0 deletions include/glaze/network/server.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@

#include "glaze/network/socket.hpp"

#if __has_include(<libfork/core.hpp>)
#else
static_assert("libfork is required for using glaze network code. The library must be included by the developer.");
#endif

#ifdef _WIN32
#define GLZ_CLOSE_SOCKET closesocket
#define GLZ_EVENT_CLOSE WSACloseEvent
Expand Down
11 changes: 10 additions & 1 deletion tests/socket_test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
project(socket_test)

FetchContent_Declare(
libfork
GIT_REPOSITORY https://github.com/conorwilliams/libfork.git
GIT_TAG v3.8.0
GIT_SHALLOW TRUE
)

FetchContent_MakeAvailable(libfork)

add_executable(${PROJECT_NAME} ${PROJECT_NAME}.cpp)

target_link_libraries(${PROJECT_NAME} PRIVATE glz_test_common)
target_link_libraries(${PROJECT_NAME} PRIVATE glz_test_common libfork::libfork)

add_test(NAME ${PROJECT_NAME} COMMAND ${PROJECT_NAME})

Expand Down
1 change: 1 addition & 0 deletions tests/socket_test/socket_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <future>
#include <latch>
#include <thread>
#include <atomic>

#include "ut/ut.hpp"

Expand Down

0 comments on commit 418abc8

Please sign in to comment.