Skip to content

Commit

Permalink
build: Fixing linting issue for build.rs
Browse files Browse the repository at this point in the history
Previously we were not registering the custom flags for rustc to check.
Adding these two lines fixes a bunch of linting issues

Signed-off-by: Larry Dewey <[email protected]>
  • Loading branch information
larrydewey committed Jul 31, 2024
1 parent 27b4e17 commit a68e1cc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
fn main() {
use std::path::Path;

// Register custom cfg flags for `has_sev` and `has_sev_guest`.
println!("cargo:rustc-check-cfg=cfg(has_sev)");
println!("cargo:rustc-check-cfg=cfg(has_sev_guest)");

// If the device driver is found, set the cfg flag
if cfg!(feature = "hw_tests") || Path::new("/dev/sev").exists() {
println!("cargo:rustc-cfg=has_sev");
}
Expand Down

0 comments on commit a68e1cc

Please sign in to comment.