This library provides the primary interface to uProtocol for uEntity applications. The primary point of interaction for most applications will be the layer 2 "communications" objects.
In addition to up-cpp
, a uEntity will also need at least on transport
implementation, such as up-transport-zenoh-cpp.
IMPORTANT NOTE: This project is under active development
- Compiler: GCC/G++ 11 or Clang 13
- Conan : 1.59 or latest 2.x
Using the recipes found in up-conan-recipes, build these Conan packages:
- up-core-api:
conan create --version 1.6.0 --build=missing up-core-api/release
NOTE: all conan
commands in this document use Conan 2.x syntax. Please
adjust accordingly when using Conan 1.x.
To add up-cpp to your conan build dependencies, place following in your conanfile.txt:
[requires]
up-cpp/[~1.0]
[generators]
CMakeDeps
CMakeToolchain
[layout]
cmake_layout
NOTE: If using conan version 1.59 Ensure that the conan profile is configured to use ABI 11 (libstdc++11: New ABI) standards according to the Conan documentation for managing gcc ABIs.
The following steps are only required for developers to locally build and test up-cpp, If you are making a project that uses up-cpp, follow the steps in the How to Use the Library section above.
From the root of this repo, run:
conan install --build=missing .
cmake --preset conan-release
cd build/Release
cmake --build . -- -j
Once the build completes, tests can be run with ctest
.
Debug builds can be generated by changing those steps to:
conan install --build=missing --settings=build_type=Debug .
cmake --preset conan-debug
cd build/Debug
cmake --build . -- -j
To get code coverage, perform the steps above, but replace cmake --preset...
with
cd build/Release
cmake ../../ -DCMAKE_TOOLCHAIN_FILE=generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Coverage
Once the tests complete, the Unit Test Coverage report can be generated from the base up-cpp folder with: ./Coverage.sh
./coverage.sh
TODO Verify steps for pure cmake build without Conan.
See: up-conan-recipes
Give a ⭐️ if this project helped you!