Add the sceleton for an asio example

This commit is contained in:
Denis Blank 2017-10-04 19:46:30 +02:00
parent dcadc77956
commit 79dedef359
7 changed files with 86 additions and 0 deletions

3
.gitmodules vendored
View File

@ -7,3 +7,6 @@
[submodule "dep/cxx_function/cxx_function"] [submodule "dep/cxx_function/cxx_function"]
path = dep/cxx_function/cxx_function path = dep/cxx_function/cxx_function
url = https://github.com/potswa/cxx_function.git url = https://github.com/potswa/cxx_function.git
[submodule "dep/asio/asio"]
path = dep/asio/asio
url = https://github.com/chriskohlhoff/asio.git

View File

@ -6,6 +6,10 @@ if(CONTINUABLE_UNIT_TESTS AND NOT TARGET cxx_function)
add_subdirectory(cxx_function) add_subdirectory(cxx_function)
endif() endif()
if(CONTINUABLE_UNIT_TESTS AND NOT TARGET asio)
add_subdirectory(asio)
endif()
if(NOT TARGET function2) if(NOT TARGET function2)
add_subdirectory(function2) add_subdirectory(function2)
endif() endif()

29
dep/asio/CMakeLists.txt Normal file
View File

@ -0,0 +1,29 @@
add_library(asio STATIC
${CMAKE_CURRENT_LIST_DIR}/asio/asio/src/asio.cpp)
target_include_directories(asio
PUBLIC
${CMAKE_CURRENT_LIST_DIR}/asio/asio/include)
target_compile_definitions(asio
PUBLIC
-DASIO_STANDALONE=1
-DASIO_SEPARATE_COMPILATION=1
-DASIO_NO_TYPEID=1)
if(WIN32)
target_compile_definitions(asio
PUBLIC
-D_WIN32_WINNT=0x0501)
endif()
target_compile_features(asio
PUBLIC
cxx_alias_templates
cxx_auto_type
cxx_decltype
cxx_final
cxx_lambdas
cxx_variadic_templates
cxx_defaulted_functions
cxx_nullptr)

1
dep/asio/asio Submodule

@ -0,0 +1 @@
Subproject commit 230c0d2ae035c5ce1292233fcab03cea0d341264

View File

@ -0,0 +1 @@
add_subdirectory(asio-banking)

View File

@ -0,0 +1,11 @@
add_executable(example-asio-banking
${CMAKE_CURRENT_LIST_DIR}/example-asio-banking.cpp)
target_include_directories(example-asio-banking
PRIVATE
${CMAKE_CURRENT_LIST_DIR})
target_link_libraries(example-asio-banking
PRIVATE
asio
continuable)

View File

@ -0,0 +1,37 @@
/*
/~` _ _ _|_. _ _ |_ | _
\_,(_)| | | || ||_|(_||_)|(/_
https://github.com/Naios/continuable
v2.0.0
Copyright(c) 2015 - 2017 Denis Blank <denis.blank at outlook dot com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files(the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions :
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
**/
#include <asio/io_service.hpp>
#include <continuable/continuable.hpp>
int main(int, char**) {
return 0;
}