Skip to content

sbromberger/cpp_bootstrap

Repository files navigation

C++ Bootstrap

This repository provides a base template for a C++ header-only library.

It includes extensive CI coverage, Docker support, and a development container setup for consistent and flexible development across multiple environments.

The template is designed to support different configurations and ensure compatibility across compilers, C++ standards, and package managers.

Motivation: Why Wide Coverage?

Reusable and generic libraries are meant to be integrated into various projects across diverse systems, each with unique requirements and configurations. To achieve true reusability, a library must demonstrate compatibility with multiple compilers, C++ standard versions, package managers, and build types. This template addresses these needs, ensuring your library is flexible, stable, and accessible in multiple development environments.

Key Benefits of Comprehensive Coverage

  • Maximized Compatibility: Broad support for different C++ standards (from C++11 to C++20) ensures that your library can be integrated into projects with varying standard requirements. By covering multiple compilers, including GCC and Clang, the library is prepared for use in almost any C++ ecosystem.
  • Robust Testing Across Configurations: With configurations for both Debug and Release builds, the CI setup helps identify potential issues that might only appear in certain environments or build types, making the library more reliable in production settings.
  • Enhanced Portability: By integrating Docker and development containers, developers and CI systems can replicate the same environment, reducing inconsistencies across development and deployment. This setup provides a uniform testing ground for your library's functionality on different systems, improving portability.
  • Dependency Flexibility with Package Managers: Supporting Conan and vcpkg helps users manage dependencies and simplifies integration into larger projects, as they can choose the package manager that best fits their workflow. This ensures smoother transitions and compatibility within varied build systems.

Features

  • Header-Only Design: Lightweight, requiring no separate compilation.
  • Extensive GitLab CI Pipeline:
    • C++ Standard Versions: Can test multiple standards (e.g. C++11, C++14, C++17, C++20, C++23).
    • Compilers: Configured for both GCC and Clang.
    • Package Managers: Supports Conan and vcpkg for dependency management.
    • Build Types:: In CMake, the build type typically specifies the level of optimization, debug information, and other compiler flags.
      • Debug: Compiles with full debug information, disabling most optimizations. Useful for development and debugging.
      • Release: Optimized for performance, without debug symbols. Ideal for production builds.
      • RelWithDebInfo (Release with Debug Information): Enables optimizations but also includes debug symbols, making it useful for profiling and debugging optimized builds.
      • MinSizeRel (Minimum Size Release): Optimizes for the smallest binary size, often used in embedded systems.
  • Docker Support: The project includes a Docker setup for replicable environments, allowing developers to build, test, and run the library consistently across different systems.
  • Development Container (devcontainer): Supports Visual Studio Code’s Dev Containers, enabling a pre-configured development environment with all dependencies and settings to be shared across team members.
  • Unit Testing The project embeds the Boost Lightweight Test: just add your tests in the test/ folder, they will get compiled and run and errors reported.
  • Examples and Documentation The project embeds Doxygen for documenting the code, doxygen-awesome to give it a modern look, and the CI automatically publishes it on the GitLab pages. Any example program located in the example/ folder will be compiled, run, their output recorded and added if required to the generated documentation pages.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors