Skip to content

Commit e1bb605

Browse files
afbjorklundslp
authored andcommitted
Add the dylib linker flags for macOS
Signed-off-by: Anders F Björklund <[email protected]>
1 parent bd27159 commit e1bb605

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/libkrun/build.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,11 @@ fn main() {
55
std::env::var("CARGO_PKG_VERSION_MAJOR").unwrap()
66
);
77
#[cfg(target_os = "macos")]
8+
println!(
9+
"cargo:rustc-cdylib-link-arg=-Wl,-install_name,libkrun.{}.dylib,-compatibility_version,{}.0.0,-current_version,{}.{}.0",
10+
std::env::var("CARGO_PKG_VERSION_MAJOR").unwrap(), std::env::var("CARGO_PKG_VERSION_MAJOR").unwrap(),
11+
std::env::var("CARGO_PKG_VERSION_MAJOR").unwrap(), std::env::var("CARGO_PKG_VERSION_MINOR").unwrap()
12+
);
13+
#[cfg(target_os = "macos")]
814
println!("cargo:rustc-link-lib=framework=Hypervisor");
915
}

0 commit comments

Comments
 (0)