mesonbuild/meson

Static boost dependencies do not include transitive dependencies

Open

#15.457 aperta il 11 gen 2026

Vedi su GitHub
 (2 commenti) (0 reazioni) (0 assegnatari)Python (1465 fork)batch import
boostbugdependencieshelp wanted

Metriche repository

Star
 (4978 star)
Metriche merge PR
 (Merge medio 30g 19h) (63 PR mergiate in 30 g)

Descrizione

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

Guida contributor