Linux shared library for serial communication. It implements the
cpp-core interface and provides functions for discovering, opening,
configuring, reading from, and writing to serial ports.
- Linux
- Git
- CMake 3.30 or newer
- Ninja
- A compiler with C++26 support (CI uses GCC 16)
CMake downloads cpp-core and GoogleTest automatically during configuration.
git clone https://github.com/Serial-IO/cpp-bindings-linux.git
cd cpp-bindings-linux
cmake --preset linux-gcc-release
cmake --build --preset linux-gcc-release --target cpp_bindings_linuxThe shared library is written to build/libcpp_bindings_linux.so.
To select a specific compiler, add it while configuring, for example:
cmake --preset linux-gcc-release \
-DCMAKE_C_COMPILER=gcc-16 \
-DCMAKE_CXX_COMPILER=g++-16Build and run the C++ test suite:
cmake --build --preset linux-gcc-release --target cpp_bindings_linux_tests
ctest --test-dir build --output-on-failureTests that require a serial device use SERIAL_TEST_PORT. They are skipped when no suitable device is available.
The optional Deno FFI smoke tests require Deno 2 and a built library:
cd integration_tests
deno task testThis project is licensed under the GNU Lesser General Public License v3.0.