Skip to content

Commit 8b60471

Browse files
committed
Use DLL_EXTENSION rather than hardcoding .so
Non-Linux platforms should be able to build the backend, but MacOS can't find the shared library because the extension is incorrect. Use `DLL_EXTENSION` rather than a fixed `.so`.
1 parent 763d3eb commit 8b60471

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

bootstrap/src/manifest.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use anstream::eprintln as println;
22
use color_print::cprintln;
3+
use std::env;
34
use std::path::{Path, PathBuf};
45
use std::process::Command;
56

@@ -45,12 +46,13 @@ impl Manifest {
4546
}
4647

4748
/// The path to the rustc codegen c library
48-
pub fn codegen_backend(&self) -> &'static Path {
49-
if self.release {
50-
Path::new("crates/target/release/librustc_codegen_c.so")
49+
pub fn codegen_backend(&self) -> PathBuf {
50+
let path = if self.release {
51+
Path::new("crates/target/release/librustc_codegen_c")
5152
} else {
52-
Path::new("crates/target/debug/librustc_codegen_c.so")
53-
}
53+
Path::new("crates/target/debug/librustc_codegen_c")
54+
};
55+
path.with_extension(env::consts::DLL_EXTENSION)
5456
}
5557

5658
/// The command to run rustc with the codegen backend

0 commit comments

Comments
 (0)