From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- third_party/rust/bindgen/deps.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 third_party/rust/bindgen/deps.rs (limited to 'third_party/rust/bindgen/deps.rs') diff --git a/third_party/rust/bindgen/deps.rs b/third_party/rust/bindgen/deps.rs new file mode 100644 index 0000000000..987225b28e --- /dev/null +++ b/third_party/rust/bindgen/deps.rs @@ -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) -> 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) + } +} -- cgit v1.2.3