Skip to content

Commit fde81c7

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 fde81c7

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

bootstrap/src/manifest.rs

+7-5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use anstream::eprintln as println;
22
use color_print::cprintln;
33
use std::path::{Path, PathBuf};
44
use std::process::Command;
5+
use std::env;
56

67
pub struct Manifest {
78
pub verbose: bool,
@@ -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)