Exclusion of static libs for static runtime usage

Open
#8 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
cmake
Domain
build-system

Research direction

Reproduce the default ./b2 install layout on Linux and inspect the CMake configuration logic shown for chrono, especially the Boost_USE_STATIC_RUNTIME check. Compare system and tagged layouts with static and shared runtime builds, then verify whether allowing the static library for both runtime choices works without breaking the platform-specific behavior noted in the issue.

Written by the indexing model from the issue text.

Description

If I do a build with default settings (e.g. just ./b2 install) on linux, I get dynamic and static libs built using the system naming convention. By default, boost assumes a shared runtime. For static libs, however, does it really matter? For instance, my consuming application specifies both Boost_USE_STATIC_LIBS and Boost_USE_STATIC_RUNTIME and thus the default install fails to find the library because of this cmake config code (just using chrono as an example here) :

# runtime-link=shared

if(Boost_USE_STATIC_RUNTIME)
    _BOOST_SKIPPED("libboost_chrono.a" "shared runtime, Boost_USE_STATIC_RUNTIME=${Boost_USE_STATIC_RUNTIME}")
    return()
endif()

When I switch to a tagged layout and build versions for both static and shared runtime, I get two copies of what appear to be the same static library. Couldn't we just make an exception and allow the system layout to work for either runtime choice? I realize this might be OS dependent since windows is clearly different in this regard and apple-clang doesn't allow static runtime at all (I believe).

Dominant language
C
Stars
11
Forks
37
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from boostorg/boost_install

All issues in boostorg/boost_install

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.