Skip to content

Commit dc04ff8

Browse files
merge: dev into master
Feature: First version of the library
2 parents de5312e + 955f159 commit dc04ff8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+7292
-0
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,7 @@
3030
*.exe
3131
*.out
3232
*.app
33+
34+
.idea
35+
36+
build-debug

CMakeLists.txt

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
cmake_minimum_required(VERSION 3.17)
2+
project(NetworkLibrary)
3+
4+
set(CMAKE_CXX_STANDARD 20)
5+
6+
if (NOT TARGET PolymorphNetwork)
7+
if (NOT TARGET asio)
8+
include(cmake/FindAsio.cmake)
9+
FIND_PACKAGE(asio REQUIRED)
10+
endif ()
11+
12+
13+
file(GLOB_RECURSE SRCS src/*.cpp)
14+
list(REMOVE_ITEM SRCS src/main.cpp)
15+
16+
file(GLOB_RECURSE ICLS include/*.hpp)
17+
file(GLOB_RECURSE PRIV_ICLS src/include/*.hpp)
18+
19+
add_library(PolymorphNetwork ${SRCS} ${ICLS} ${PRIV_ICLS})
20+
target_include_directories(PolymorphNetwork PUBLIC include)
21+
target_include_directories(PolymorphNetwork PRIVATE src/include)
22+
target_link_libraries(PolymorphNetwork asio)
23+
if(WIN32)
24+
# MSVC
25+
# /wd4100: unreferenced formal parameter (= unused parameter)
26+
target_compile_options(PolymorphNetwork PRIVATE /W4)
27+
endif()
28+
endif()
29+
30+
if (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
31+
include(tests/cmake/FindGoogleTest.cmake)
32+
enable_testing()
33+
34+
add_subdirectory(tests)
35+
endif ()

FindPolymorphNetworkLibrary.cmake

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
cmake_minimum_required(VERSION 3.17)
2+
3+
if (NOT TARGET PolymorphNetwork)
4+
include(FetchContent)
5+
FetchContent_Declare(
6+
PolymorphNetwork
7+
GIT_REPOSITORY [email protected]:PolymorphEngine/NetworkLibrary.git
8+
GIT_TAG master
9+
)
10+
FetchContent_MakeAvailable(PolymorphNetwork)
11+
endif()

0 commit comments

Comments
 (0)