Skip to content

Commit

Permalink
Add example project
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacquwes committed Sep 27, 2023
1 parent 4f77334 commit 173d902
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ add_definitions(-D_WIN32_WINNT=0x0A00)

add_subdirectory(shared)
add_subdirectory(server)
add_subdirectory(tests)
add_subdirectory(tests)
add_subdirectory(examples/server)
14 changes: 14 additions & 0 deletions examples/server/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
project(server_example)

file(GLOB_RECURSE HEADER_FILES "*.h")
file(GLOB_RECURSE SOURCE_FILES "*.cpp")

add_executable(
example
${HEADER_FILES}
${SOURCE_FILES}
)

target_link_libraries(example PRIVATE shared)
target_link_libraries(example PRIVATE server)
target_link_libraries(example PRIVATE asio)
14 changes: 14 additions & 0 deletions examples/server/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Purpose: Source file for server example.

#include <iostream>

#include <asio.hpp>
#include <server.h>

int main()
{
asio::io_context context{};
pine::server server{ context };

server.listen();
}

0 comments on commit 173d902

Please sign in to comment.