1

Currently all my header files are included via the include_directories() method that which returns an inc type.

Is there a way in meson to extract the headers files from it? Preferably into the file type.

I want to use the header files as an input to my formatter.

I know that I can gather the files separately via the files method. That would require more work to maintain.

But I'm hoping that there is an easier, more straightforward way.

1
  • Did you try looping with foreach? Something like: foreach header: headers where headers has the collection return by include_directories. collected around your subdirs. Commented Sep 3, 2024 at 16:33

1 Answer 1

0

include_directories returns an inc object, which is opaque, meaning there is no way to inspect it or its internal details. As such, you cannot take an inc object and extract any meaningful data from it, for example the list of directories pointed to, or the header files referred to by it.

If you need a collection of header files, your best option is to create your own files() object which specifies these exactly.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.