Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for generating a Make compatible depfile #41

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

dcbaker
Copy link

@dcbaker dcbaker commented Mar 29, 2024

This allows fypp to communicate to build systems like Make and Ninja (including through build system generators like CMake and Meson) files that need to be implicitly included in the build graph. This is important for getting correct incremental rebuilds when such a file is changed.

This allows executing the unittests directly with `python test_fypp.py`,
which allowing easily passing options into the test harness. It also
avoids having to know if user has set PYTHONPATH, since it will be
evaluated after PYTHONPATH.
Copy link
Owner

@aradi aradi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a very nice addition, thanks! The only thing I am somewhat unsure about is the escaping, see my comments below.

bin/fypp Outdated Show resolved Hide resolved
bin/fypp Outdated Show resolved Hide resolved
bin/fypp Outdated Show resolved Hide resolved
test/test_fypp.py Outdated Show resolved Hide resolved
bin/fypp Show resolved Hide resolved
This allows build systems that can consume them (Make and Ninja, in
particular) to figure out at build time which files are implicitly
included in the dependency graph of a fypp output.

This means for example if you have a target that includes two other
files, an incremental rebuild can be triggered automatically if one of
the included files are modified.
@dcbaker
Copy link
Author

dcbaker commented Apr 8, 2024

Updated with the requested changes. I've also updated the test case, and added a couple of more cases, including one to explicitly test the escaping behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants