boostorg / boostorg/exception

Inconsistency between b2 and CMake builds regarding library type (Static vs. Header-only)

Open
#65 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
17
Forks
50
PR merge metrics
No merged PRs in 30d

Description

Greetings! 👋

There appears to be an inconsistency in how the Boost.Exception library is built and packaged depending on the build system used (b2 vs. CMake). I know b2 is the official one and CMake is optional, but this difference and as b2 only provide static library makes me think about this case.

**With b2**: The library [forces a static build](https://github.com/boostorg/exception/blob/boost-1.92.0.beta1/build/Jamfile.v2#L11). Even when passing the [global link=shared property](https://www.bfgroup.xyz/b2/manual/release/index.html#b2.tutorial.linkage) to b2 to generate shared libraries across Boost, Boost.Exception overrides this behavior in its build configuration, hardcoding it to build strictly as a static library.

**With CMake**: The CMakeLists.txt configures Boost.Exception entirely as a [header-only (INTERFACE) library](https://github.com/boostorg/exception/blob/boost-1.92.0.beta1/CMakeLists.txt#L10), offering no option to build a compiled/pre-built library component.

* Is the static restriction in Jamfile.v2 intended design, or is it a legacy artifact/bug?

* Is Boost.Exception officially supposed to be treated strictly as a header-only library going forward (as suggested by the CMake configuration)?

Regards!

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with build/Jamfile.v2 and CMakeLists.txt, especially the linked library configuration lines, and compare how each build system represents Boost.Exception. Determine the intended library type and linkage behavior; the issue is resolved when the project’s expected behavior is decided and the two configurations are made consistent or the difference is clearly documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp
Domain
build-system
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.