mesonbuild / mesonbuild/meson

Feature Request: include_file() or subfile()

Open
#375 1 comment 3 reactions 0 assignees View on GitHub
design discussion
Dominant language
Python
Stars
6.6k
Forks
1.9k
Avg merge
2d 6h
Merged PRs (30d)
33

Description

I'd like to be able to do something like

```
subfile('versions.meson')
subfile('package-defines.meson')
subfile('opengl.meson')
subfile('options.meson')
subfile('linkerflags.meson')
```

to easily share the same snippets across multiple modules/projects without having to copy'n'paste them.

This could be done via subdirectories with subdir() of course, but that seems awkward, and I'd like to keep all those files together in one directory. I think this is nicer.

Contributor guide

Open the contributing guide

Research direction

Start by examining the existing subdir() behavior and the handling of Meson files, then determine how a subfile() or include_file() operation would share snippets across modules and projects. Done should provide a defined, tested way to reuse files from one directory without copying them into each project.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.