Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support emitting Makefile-syntax depfiles like gcc/clang/rustc.
Needed to auto-bindgen with a ninja build without the build graph going stale.
- Loading branch information
Showing
10 changed files
with
221 additions
and
9 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/// Generating build depfiles from parsed bindings. | ||
use std::{collections::BTreeSet, path::PathBuf}; | ||
|
||
#[derive(Debug)] | ||
pub(crate) struct DepfileSpec { | ||
pub output_module: String, | ||
pub depfile_path: PathBuf, | ||
} | ||
|
||
impl DepfileSpec { | ||
pub fn write(&self, deps: &BTreeSet<String>) -> std::io::Result<()> { | ||
let mut buf = format!("{}:", self.output_module); | ||
|
||
for file in deps { | ||
buf = format!("{} {}", buf, file); | ||
} | ||
|
||
std::fs::write(&self.depfile_path, &buf) | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
tests/expectations/tests/enum-default-rust.rs: tests/headers/enum-default-rust.h tests/headers/enum.h |
Oops, something went wrong.