Vendor things
This commit is contained in:
parent
5deceec006
commit
977e3c17e5
19434 changed files with 10682014 additions and 0 deletions
20
third-party/vendor/bindgen/deps.rs
vendored
Normal file
20
third-party/vendor/bindgen/deps.rs
vendored
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
/// Generating build depfiles from parsed bindings.
|
||||
use std::{collections::BTreeSet, path::PathBuf};
|
||||
|
||||
#[derive(Clone, 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)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue