diff --git a/.gitmodules b/.gitmodules index 2d624cc..95d518b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,3 +7,6 @@ [submodule "dep/cxx_function/cxx_function"] path = dep/cxx_function/cxx_function url = https://github.com/potswa/cxx_function.git +[submodule "dep/asio/asio"] + path = dep/asio/asio + url = https://github.com/chriskohlhoff/asio.git diff --git a/dep/CMakeLists.txt b/dep/CMakeLists.txt index f6df0d2..4126ad9 100644 --- a/dep/CMakeLists.txt +++ b/dep/CMakeLists.txt @@ -6,6 +6,10 @@ if(CONTINUABLE_UNIT_TESTS AND NOT TARGET cxx_function) add_subdirectory(cxx_function) endif() +if(CONTINUABLE_UNIT_TESTS AND NOT TARGET asio) + add_subdirectory(asio) +endif() + if(NOT TARGET function2) add_subdirectory(function2) endif() diff --git a/dep/asio/CMakeLists.txt b/dep/asio/CMakeLists.txt new file mode 100644 index 0000000..59c1dde --- /dev/null +++ b/dep/asio/CMakeLists.txt @@ -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) diff --git a/dep/asio/asio b/dep/asio/asio new file mode 160000 index 0000000..230c0d2 --- /dev/null +++ b/dep/asio/asio @@ -0,0 +1 @@ +Subproject commit 230c0d2ae035c5ce1292233fcab03cea0d341264 diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index e69de29..64667f6 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(asio-banking) diff --git a/examples/asio-banking/CMakeLists.txt b/examples/asio-banking/CMakeLists.txt new file mode 100644 index 0000000..01efb17 --- /dev/null +++ b/examples/asio-banking/CMakeLists.txt @@ -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) diff --git a/examples/asio-banking/example-asio-banking.cpp b/examples/asio-banking/example-asio-banking.cpp new file mode 100644 index 0000000..220ee78 --- /dev/null +++ b/examples/asio-banking/example-asio-banking.cpp @@ -0,0 +1,37 @@ + +/* + + /~` _ _ _|_. _ _ |_ | _ + \_,(_)| | | || ||_|(_||_)|(/_ + + https://github.com/Naios/continuable + v2.0.0 + + Copyright(c) 2015 - 2017 Denis Blank + + 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 +#include + +int main(int, char**) { + + return 0; +}