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-alpha4 --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
Before building up-cpp we need to build all dependencies from up-conan-recipes:
Please follow instruction for QNX build in file up-conan-recipes/README.md
Pre-requisite:
- Build and install all QNX build dependencies from up-conan-recipes
# setup path to up-conan-recipes
export QNX_CONAN_ROOT=<path_to_up-conan-recipes>
# Install conan toolchain for QNX target
#
# <profile-name>: nto-7.1-aarch64-le, nto-7.1-x86_64, nto-8.0-aarch64-le, nto-8.0-x86_64
# <version-number>: 1.0.0-rc0, 1.0.0, 1.0.1-rc1, 1.0.1
#
conan install -pr:h=$QNX_CONAN_ROOT/tools/profiles/<profile-name> --version=<version-number> --build=missing .
cmake --preset conan-release
cmake --build build/Release -- -j
# all tests you can find under build/Release/bin/
# copy test binaries to your QNX target
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!