Skip to content

Commit

Permalink
chore: bump symver, introduce regenerate feature in favor of `vendo…
Browse files Browse the repository at this point in the history
…red` feature
  • Loading branch information
oberrich committed Apr 12, 2024
1 parent cce53ad commit 96455b2
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 12 additions & 13 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
[package]
name = "phnt"
version = "0.0.21"
license = "MIT"
authors = ["oberrich <[email protected]>"]
repository = "https://github.com/oberrich/phnt-rs"
homepage = "https://github.com/oberrich/phnt-rs"
edition = "2021"
build = "src/build.rs"
name = "phnt"
version = "0.0.22"
license = "MIT"
authors = ["oberrich <[email protected]>"]
repository = "https://github.com/oberrich/phnt-rs"
homepage = "https://github.com/oberrich/phnt-rs"
edition = "2021"
build = "src/build.rs"
description = "Rust bindings to the System Informer's (formerly known as Process Hacker) `phnt` native Windows headers"
# exclude = ["deps"]

[features]
vendored = []
regenerate = []

[package.metadata.docs.rs]
all-features = true
default-target = "x86_64-pc-windows-msvc"
targets = ["x86_64-pc-windows-msvc"]
rustdoc-args = ["--cfg", "docsrs"]
Expand All @@ -25,12 +24,12 @@ windows.features = ["Win32_Foundation"]
windows-targets = "0.52.0"
windows.version = "0.52.0"
bindgen = "0.69.4"
regex = "1.10.3"
chrono = "0.4.37"
regex = "1.10.3"
chrono = "0.4.37"

[dependencies]
windows.features = ["Win32_Foundation"]
windows-targets = "0.52.0"
windows.version = "0.52.0"
nt-string = "0.1.1"
cty = "0.2.2"
cty = "0.2.2"
11 changes: 6 additions & 5 deletions src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#![cfg_attr(docsrs, feature(doc_cfg))]
use std::collections::HashMap;
use std::env;
#[cfg(all(not(feature = "vendored"), not(docsrs)))]
#[cfg(feature = "regenerate")]
use std::path::PathBuf;

use regex::Regex;
Expand Down Expand Up @@ -133,14 +133,15 @@ impl BindgenConfig {
}
}

#[cfg_attr(docsrs, doc(cfg(any(feature = "vendored", docsrs))))]
#[cfg(any(feature = "vendored", docsrs))]
#[cfg_attr(docsrs, doc(cfg(not(feature = "regenerate"))))]
#[cfg(not(feature = "regenerate"))]
fn main() {
println!("Using vendored bindings, build script skipped.");
}

#[cfg_attr(docsrs, doc(cfg(all(not(feature = "vendored"), not(docsrs)))))]
#[cfg(all(not(feature = "vendored"), not(docsrs)))]
// TODO(chore): Make vendored the default behavior and instead respect the "regenerate"
#[cfg_attr(docsrs, doc(cfg(feature = "regenerate")))]
#[cfg(feature = "regenerate")]
fn main() {
std::process::Command::new("git")
.args(["submodule", "update", "--remote", "--recursive"])
Expand Down
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@
/// Bindings for `phnt` (nightly) generated by `bindgen`
pub mod ffi {
// use vendored bindings
#[cfg_attr(docsrs, doc(cfg(any(feature = "vendored", docsrs))))]
#[cfg(any(feature = "vendored", docsrs))]
#[cfg_attr(docsrs, doc(cfg(not(feature = "regenerate"))))]
#[cfg(not(feature = "regenerate"))]
include!("ffi/generated.rs");

// use re-generated bindings
#[cfg_attr(docsrs, doc(cfg(all(not(feature = "vendored"), not(docsrs)))))]
#[cfg(all(not(feature = "vendored"), not(docsrs)))]
#[cfg_attr(docsrs, doc(cfg(feature = "regenerate")))]
#[cfg(feature = "regenerate")]
include!(concat!(env!("OUT_DIR"), "\\generated.rs"));
}

Expand Down

0 comments on commit 96455b2

Please sign in to comment.