Skip to content

Replace usage of boost::program_option with ini-cpp #75

Description

@tan2

Currently, our codebase relies on boost::program_options for parameter parsing. While powerful, Boost is a massive dependency that bloats our build times, complicates our CI/CD pipelines, and feels unnecessarily heavy since we only need to parse INI-format configuration files.

I propose replacing boost::program_options with ini-cpp (specifically the C++17 wrapper: SSARCandy/ini-cpp). It provides a modern, header-only implementation that perfectly meets our strict requirements:

  • Native support for default values.
  • Native support for extracting vectors (GetVector<T>).
  • Built-in capabilities to dump/write the configuration back to a file.

Pros of switching to ini-cpp:

  • Faster Compile Times: ini-cpp is a lightweight, header-only library. It removes the need to build and link against compiled Boost libraries.
  • Cleaner Syntax: It leverages modern C++17, replacing Boost's verbose macro-like option declarations with a very clean, straightforward reader.Get<T>() API.
  • Simplified Dependency Management: We can drop the heavy Boost requirement from our CMake/vcpkg setups, shrinking our project footprint.

GitHub Repository: https://github.com/SSARCandy/ini-cpp

Official Documentation: https://ssarcandy.tw/ini-cpp/index.html

API Reference (inih namespace): https://ssarcandy.tw/ini-cpp/namespaceinih.html

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions