Skip to content

Latest commit

 

History

History
159 lines (117 loc) · 4.72 KB

README.md

File metadata and controls

159 lines (117 loc) · 4.72 KB

cpp-msgpack-light

GitLab Release C++ standard pipeline status pre-commit

A light library to serialize MessagePack.

This library implements MessagePack specification updated on 2021/4/29 (latest as of 2024/2/14).

Documentation

Repositories

Installation

Simply Including Headers

This library is header-only, so you can simply include headers setting include directory to an include directory of compilers. This library depends only on C++ standard library, so no further installation is required.

Via vcpkg

This library can be installed via vcpkg using following configurations:

  • Add a vcpkg registry https://gitlab.com/MusicScience37Projects/vcpkg-registry in vcpkg-configuration.json.

    Example:

    {
      "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg-configuration.schema.json",
      "default-registry": {
        "kind": "git",
        "repository": "https://github.com/Microsoft/vcpkg",
        "baseline": "7aeffc91033ad35cc4e2c152f213a866ec6c11ac"
      },
      "registries": [
        {
          "kind": "git",
          "repository": "https://gitlab.com/MusicScience37Projects/vcpkg-registry",
          "baseline": "bd7d4ded3e5312cc66f16bc729317ec64fa4e613",
          "packages": ["cpp-msgpack-light"]
        }
      ]
    }
  • Add cpp-msgpack-light in vcpkg.json

    Example:

    {
      "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
      "dependencies": ["cpp-msgpack-light"]
    }

How to Build in the Repository

Dependencies

A development environment including dependencies can be created using Devcontainer of VSCode.

To build this repository, you will require following dependencies:

  • Python 3.12
    • You may want to use pyenv.
  • poetry
    • Required Python packages can be installed using poetry. Execute the command poetry install on this directory.
    • pre-commit will be installed via poetry, and used for some checks. Execute poetry run pre-commit install on this directory if you develop this library.
  • CMake
  • C++ 17 Compiler
    • Following compilers are tested in CI:
      • GCC 10
      • GCC 12
      • Clang 16
      • Clang 18
      • MSVC 19

Additionally, you will require following dependencies to build documentation.

  • Doxygen
  • Graphviz
  • PlantUML
    • Set PLANTUML_JAR_PATH environment variable to specify the place of plantuml.jar file.
  • Java runtime environment (JRE) for PlantUML.

Build

If you created the development environment via Devcontainer of VSCode, you can build this repository using CMake Tools extension.

To build using command line, follow the steps below.

  1. Start a shell of poetry.

    cd <this-directory>
    poetry install
    poetry shell
  2. Download vcpkg if you haven't already.

    git submodule update --init
  3. Configure.

    mkdir build
    cd build
    cmake .. -DCMAKE_TOOLCHAIN_FILE=../vcpkg/scripts/buildsystems/vcpkg.cmake
  4. Optionally edit options.

    <some-editor> CMakeCache.txt
  5. Build.

    cmake --build .
  6. Optionally run tests.

    ctest

License

This project is licensed under Apache License, Version 2.0.