Installation and Usage¶
Note
This library is developed with gcc-10.2
and requires C++17. Other
compiler/standard combinations are liable to work in the alpha stage,
however they are not currently supported. This will likely be resolved
with upcoming CI integration.
Dependencies¶
Currently microlith requires ctti in order to extract service names from types, however this requirement is tentative and subject to change in a future release. microlith also requires spdlog, but can be configured to disable this dependency and remove/override logging.
Installation¶
microlith supports a variety of installation methods, the following are just a few examples:
Copy¶
While microlith is not header only, it self-packages it’s ctti
dependency and can be configured not to use spdlog using the
MICROLITH_NO_SPDLOG
cmake definition. At this point, microlith can be
added as a submodule into a project as long as a cmake/3.16.3 or greater is
installed.
CMake¶
While microlith is primarily developed (and consumed) using Conan, it’s CMakeLists.txt files have been carefully crafted to allow alternatives build systems and environments.
spdlog can be disabled by using the MICROLITH_NO_SPDLOG
cmake
definition seen below:
cmake -DMICROLITH_NO_SPDLOG='ON'
ctti can be embedded within microlith in the event that it cannot be
found with find_package
through a similar fashion:
cmake -DMICROLITH_EMBED_CTTI='ON'
CMake + Conan¶
Conan is targeted primarily as it is currently the standard build system for microlith.
Note
The official Conan documentation is the primary resource for learning about Conan.
microlith releases are not currently hosted on the Conan-Center, however that is the ultimate goal once microlith leaves the alpha stage. Conan packages can be created using the following steps:
Clone the repository
git clone ssh://git@github.com:dragozir/microlith-cpp.git
Prepare the build directories
cd microlith-cpp
mkdir build && cd build
Build using Conan
conan create ..
Add microlith as a requirement in your conanfile
[requires]
microlith/0.0.5
requires = ("microlith/0.0.5",)