mesonbuild/meson

Static boost dependencies do not include transitive dependencies

Open

#15457 opened on Jan 11, 2026

View on GitHub
 (2 comments) (0 reactions) (0 assignees)Python (4,978 stars) (1,465 forks)batch import
boostbugdependencieshelp wanted

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

Contributor guide