aboutsummaryrefslogtreecommitdiff
path: root/works/life/computer-network-experiment/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'works/life/computer-network-experiment/CMakeLists.txt')
-rw-r--r--works/life/computer-network-experiment/CMakeLists.txt23
1 files changed, 23 insertions, 0 deletions
diff --git a/works/life/computer-network-experiment/CMakeLists.txt b/works/life/computer-network-experiment/CMakeLists.txt
new file mode 100644
index 0000000..2ffd481
--- /dev/null
+++ b/works/life/computer-network-experiment/CMakeLists.txt
@@ -0,0 +1,23 @@
+cmake_minimum_required(VERSION 3.20)
+
+set(CMAKE_TOOLCHAIN_FILE $ENV{VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake
+ CACHE STRING "Vcpkg toolchain file")
+
+project(network-experiment)
+
+set(CMAKE_CXX_STANDARD 17)
+
+find_package(fmt CONFIG REQUIRED)
+find_package(Microsoft.GSL CONFIG REQUIRED)
+add_library(base STATIC Common.cpp StringUtil.cpp IO.cpp ReadWriteLock.cpp)
+target_link_libraries(base PUBLIC Microsoft.GSL::GSL fmt::fmt Folly::folly)
+if(WIN32)
+target_link_libraries(base PUBLIC Ws2_32)
+endif()
+
+add_executable(client client.cpp)
+target_link_libraries(client PRIVATE base)
+
+add_executable(server server.cpp)
+find_package(folly CONFIG REQUIRED)
+target_link_libraries(server PRIVATE base)