mesonbuild/meson

Static boost dependencies do not include transitive dependencies

Open

#15 457 ouverte le 11 janv. 2026

Voir sur GitHub
 (2 commentaires) (0 réactions) (0 assignés)Python (1 465 forks)batch import
boostbugdependencieshelp wanted

Métriques du dépôt

Stars
 (4 978 stars)
Métriques de merge PR
 (Merge moyen 30j 19h) (63 PRs mergées en 30 j)

Description

Describe the bug Using dependency('boost', static: true) for some boost module that depends on another boost module, then (assuming that a static version of the boost module was found) the latter boost module is not included in the dependency, possibly causing linker errors.

To Reproduce

meson.build:

project('repro', 'cpp')
executable('repro', 'repro.cpp', dependencies: dependency('boost', modules: ['locale'], static: true))

repro.cpp:

#include <boost/locale/util.hpp>

int main(int argc, char **argv) {
    auto locale = boost::locale::generator().generate("");
    return 0;
}

Configuring and compiling this on Arch Linux (with boost installed) will result in linker errors due to missing the thread module. Removing the static: true will link without issues.

Expected behavior Transitive dependencies are included when linking statically, as they are for pkg-config dependencies.

Note This is easy to work around as a meson user so I don't think it's a very pressing issue. But I ran into this and did not find any issues about this yet, so I am reporting it here for future reference.

System parameters

  • Native build
  • Tested on Arch Linux and Debian trixie
  • Python 3.13.11 on Arch Linux
  • Meson 1.10.0
  • Ninja 1.13.2

Guide contributeur