continuable/doc/installation.dox
2022-01-20 08:41:32 +01:00

158 lines
5.5 KiB
Plaintext

/*
Copyright(c) 2015 - 2022 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.
*/
namespace cti {
/** \page installation Installation
\brief An explanation on how to install continuable on various platforms.
\tableofcontents
\section installation-requirements Requirements
Continuable requires a fairly new toolchain and was verified to work with
following compilers:
- Visual Studio 2017+ Update 2
- Clang 5.0+
- GCC 6.0+
Although the build is observed with the listed compilers earlier
versions might work.
\warning GCC is proven to be slower than Clang in template compilation and
thus it is suggested to use Clang instead.
\section installation-dependencies Dependencies
Continuable is a header-only library with one required header-only dependency:
- [Naios/function2](https://github.com/Naios/function2) is used as type
erasure wrapper to convert a \ref continuable_base into a \ref continuable.
Additionally GTest is required as optional dependency for the asynchronous
unit testing macros defined in `continuable/support/gtest.hpp`
if those are used:
- [google/googletest](https://github.com/google/googletest) is used as
unit testing framework and to provide asynchronous testing macros.
For the examples and unit tests there might be more dependencies used,
which are fetched through git submodules.
\note The library only depends on the standard library when following
headers are used:
- `continuable/continuable-base.hpp`
- `continuable/continuable-promise-base.hpp`
- `continuable/continuable-connections.hpp`
- `continuable/continuable-promisify.hpp`
- `continuable/continuable-transforms.hpp`
\section installation-installation Installation
Making continuable available inside your project is possible through
various ways.
\subsection installation-installation-cmake Through CMake
The continuable build is driven by CMake and the project exposes CMake
interface targets when being used by external projects:
\code{.cmake}
add_subdirectory(continuable)
# continuable provides an interface target which makes it's
# headers available to all projects using the continuable library.
target_link_libraries(my_project continuable)
\endcode
When adding the continuable subdirectory as git submodule this should work
out of the box.
\code{.sh}
git submodule add https://github.com/Naios/continuable.git
\endcode
\attention On POSIX platforms you are required to link your application against
a corresponding thread library, otherwise `std::futures` won't work
properly, this is done automatically by the provided CMake project.
Additionally the CMake project exports a `continuable` target which is
importable through the \code{.cmake}find_package\endcode CMake command
when installed:
\code{.sh}
mkdir build
cd build
cmake ..
cmake --build . --target INSTALL --config Release
\endcode
In your `CMakeLists.txt`:
\code{.cmake}
find_package(continuable REQUIRED)
\endcode
\subsection installation-installation-pkg Through package managers
Continuable is present in some package managers and registries already,
and might be installed from there.
\attention The project is still looking for contributions that would help
to make it available from various package managers in order to
make the installation easier.
\subsection installation-installation-amalgamation By using the amalgamation header
For major versions there is an amalgamation header provided which can be
included without any dependency:
- [4.0.0](https://gist.githubusercontent.com/Naios/25d731aa4707d35a9bcec507f3cb9038/raw/051d2ea07b6704893c7fc9844e8d1c105c6821e0/continuable.hpp)
- [3.0.0](https://gist.githubusercontent.com/Naios/b128ab5028a7eb33e4285c0293573d9f/raw/79fe332964a786b21a8661ef65d07a5669260a3c/continuable.hpp)
\subsection installation-installation-copy By copying the headers
If you don't want to rely on CMake or package managers it is possible to
copy and include the `include` directories of continuable and
[Naios/function2](https://github.com/Naios/function2) into your project.
As an improvement git submodules could be used:
\code{.sh}
git submodule add https://github.com/Naios/continuable.git
git submodule add https://github.com/Naios/function2.git
\endcode
\section installation-unit-tests Building the unit tests
In order to build the unit tests clone the repository recursively
with all submodules:
\code{.sh}
# Shell:
git clone --recursive https://github.com/Naios/continuable.git
\endcode
Then CMake can be used to generate a project solution for testing.
*/
}