Skip to content

Commit 42dd106

Browse files
committed
Auto merge of #98989 - dpaoliello:rawdylibbin, r=michaelwoerister
Enable raw-dylib for bin crates Fixes #93842 When `raw-dylib` is used in a `bin` crate, we need to collect all of the `raw-dylib` functions, generate the import library and add that to the linker command line. I also changed the tests so that 1) the C++ dlls are created after the Rust dlls, thus there is no chance of accidentally using them in the Rust linking process and 2) disabled generating import libraries when building with MSVC.
2 parents 745193d + 0fed1a5 commit 42dd106

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/archive.rs

+9-5
Original file line numberDiff line numberDiff line change
@@ -204,12 +204,16 @@ impl<'a> ArchiveBuilder<'a> for ArArchiveBuilder<'a> {
204204
any_members
205205
}
206206

207-
fn inject_dll_import_lib(
208-
&mut self,
207+
fn sess(&self) -> &Session {
208+
self.sess
209+
}
210+
211+
fn create_dll_import_lib(
212+
_sess: &Session,
209213
_lib_name: &str,
210214
_dll_imports: &[rustc_session::cstore::DllImport],
211-
_tmpdir: &rustc_data_structures::temp_dir::MaybeTempDir,
212-
) {
213-
bug!("injecting dll imports is not supported");
215+
_tmpdir: &Path,
216+
) -> PathBuf {
217+
bug!("creating dll imports is not supported");
214218
}
215219
}

0 commit comments

Comments
 (0)