mesonbuild / mesonbuild/meson

How can attributes of a dependency (includes, compiler flags, etc.) be printed?

Open
#4,563 14 comments 12 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement parser/interpreter
Dominant language
Python
Stars
6.6k
Forks
1.9k
Avg merge
2d 6h
Merged PRs (30d)
33

Description

I'm building a C++ project with Meson and have an unexpected include directory added to my compiler args that's causing some problems. I'd like to be able to print the include directories and compiler args added by my external dependencies to debug this, but I haven't been able to figure out how to do so with Meson.

I'm aware of `get_pkgconfig_variable`, but (a) not all of my external dependencies are `pkg-config` dependencies and (b) I seem to be using this method incorrectly, e.g. `some_dep.get_pkgconfig_variable('Cflags')` tells me that the `Cflags` variable isn't defined for `some_dep` (Where `some_dep.pc` *does* have a `Cflags` variable defined, and I've tried all of `CFlags`, `Cflags`, and `cflags` in case capitalization is odd).

It seems like there should be some `include_directories` or `includes` attribute accessible for a dependency object, but I haven't been able to find anything like this. Is this possible with Meson, or am I out of luck?

Thanks!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by investigating Meson's dependency objects and the get_pkgconfig_variable entry point, comparing pkg-config and non-pkg-config dependencies. Determine whether dependency include directories and compiler arguments can be exposed for debugging, and define a supported way to print them, with documentation or tests showing the resulting output.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.