Skip to content

Commit

Permalink
fix: make shims cargo test --workspace compatible
Browse files Browse the repository at this point in the history
Signed-off-by: Harald Hoyer <harald@profian.com>
  • Loading branch information
haraldh committed Dec 21, 2022
1 parent 571e2e8 commit 7934ea0
Show file tree
Hide file tree
Showing 6 changed files with 891 additions and 861 deletions.
16 changes: 10 additions & 6 deletions crates/shim-kvm/build.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
// SPDX-License-Identifier: Apache-2.0

use std::env::var;

fn main() {
println!(
"cargo:rustc-link-arg-bin=enarx-shim-kvm=-T{}/layout.ld",
std::env::var("CARGO_MANIFEST_DIR").unwrap()
);
println!("cargo:rustc-link-arg-bin=enarx-shim-kvm=-Wl,--sort-section=alignment");
println!("cargo:rustc-link-arg-bin=enarx-shim-kvm=-nostartfiles");
if var("CARGO_CFG_TARGET_OS").expect("missing CARGO_CFG_TARGET_OS") == "none" {
println!(
"cargo:rustc-link-arg-bin=enarx-shim-kvm=-T{}/layout.ld",
std::env::var("CARGO_MANIFEST_DIR").unwrap()
);
println!("cargo:rustc-link-arg-bin=enarx-shim-kvm=-Wl,--sort-section=alignment");
println!("cargo:rustc-link-arg-bin=enarx-shim-kvm=-nostartfiles");
}
}

0 comments on commit 7934ea0

Please sign in to comment.