mesonbuild/meson

Static boost dependencies do not include transitive dependencies

Open

#15.457 aberto em 11 de jan. de 2026

Ver no GitHub
 (2 comments) (0 reactions) (0 assignees)Python (1.465 forks)batch import
boostbugdependencieshelp wanted

Métricas do repositório

Stars
 (4.978 stars)
Métricas de merge de PR
 (Mesclagem média 30d 19h) (63 fundiu PRs em 30d)

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

Guia do colaborador