-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Make it possible to override find_program [skip ci] #3218
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
de65adb
Made it possible to override find_program to return a different program.
jpakkane bdb57cf
Convert Gnome module to use find_program from interpreter.
jpakkane 4256c0d
Can override programs with scripts generated with configure_file.
jpakkane 998892e
Updated all modules to work with the new API.
jpakkane 87c166d
find_program: Only store successful lookups
nirbheek 648e130
Renamed test dirs to avoid duplicate numbers [skip ci]
jpakkane f489aa7
Added documentation [skip ci]
jpakkane 0e6a332
Document that override_find_program works on configure_file [skip ci]
nirbheek 6cdd14f
find_program: Don't spam when called from a module
nirbheek File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
## Can override find_program | ||
|
||
It is now possible to override the result of `find_program` to point | ||
to a custom program you want. The overriding is global and applies to | ||
every subproject from there on. Here is how you would use it. | ||
|
||
In master project | ||
|
||
```meson | ||
subproject('mydep') | ||
``` | ||
|
||
In the called subproject: | ||
|
||
```meson | ||
prog = find_program('my_custom_script') | ||
meson.override_find_program('mycodegen', prog) | ||
``` | ||
|
||
In master project (or, in fact, any subproject): | ||
|
||
```meson | ||
genprog = find_program('mycodegen') | ||
``` | ||
|
||
Now `genprog` points to the custom script. If the dependency had come | ||
from the system, then it would point to the system version. | ||
|
||
You can also use the return value of `configure_file()` to override | ||
a program in the same way as above: | ||
|
||
```meson | ||
prog_script = configure_file(input : 'script.sh.in', | ||
output : 'script.sh', | ||
configuration : cdata) | ||
meson.override_find_program('mycodegen', prog_script) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs an example for
configure_file()
too.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should probably go to actual documentation, people on average don't read old release notes for stuff. That would require writing a proper page for that, though...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should start linking to the release notes for each feature; the
(added in v0.xx.y)
text is a good candidate for that.