mesonbuild/meson

Static boost dependencies do not include transitive dependencies

Open

#15,457 创建于 2026年1月11日

在 GitHub 查看
 (2 评论) (0 反应) (0 负责人)Python (4,978 star) (1,465 fork)batch import
boostbugdependencieshelp wanted

描述

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

贡献者指南

Static boost dependencies do not include transitive dependencies · mesonbuild/meson#15457 | Good First Issue