mirror of
https://github.com/Naios/continuable.git
synced 2025-12-06 16:56:44 +08:00
Add the sceleton for an asio example
This commit is contained in:
parent
dcadc77956
commit
79dedef359
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -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
|
||||||
|
|||||||
@ -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
29
dep/asio/CMakeLists.txt
Normal 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
1
dep/asio/asio
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit 230c0d2ae035c5ce1292233fcab03cea0d341264
|
||||||
@ -0,0 +1 @@
|
|||||||
|
add_subdirectory(asio-banking)
|
||||||
11
examples/asio-banking/CMakeLists.txt
Normal file
11
examples/asio-banking/CMakeLists.txt
Normal 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)
|
||||||
37
examples/asio-banking/example-asio-banking.cpp
Normal file
37
examples/asio-banking/example-asio-banking.cpp
Normal 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;
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user