-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2ecb08a
commit 307f25f
Showing
3 changed files
with
34 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// When the cdylib crate type was added as a variation of dylib, it needed a test to check its function. | ||
// See https://github.com/rust-lang/rust/pull/33553 | ||
|
||
// @ignore-cross-compile | ||
|
||
use std::fs::remove_file; | ||
|
||
use run_make_support::{dynamic_lib, is_msvc, run, rustc, tmp_dir, Cc}; | ||
|
||
fn main() { | ||
rustc().input("bar.rs").run(); | ||
rustc().input("foo.rs").run(); | ||
|
||
if is_msvc() { | ||
Cc::new() | ||
.input("foo.c") | ||
.arg(tmp_dir().join("foo.dll.lib")) | ||
.out_exe("foo") | ||
.run(); | ||
} else { | ||
Cc::new() | ||
.input("foo.c") | ||
.arg("-lfoo") | ||
.output(tmp_dir().join("foo")) | ||
.library_search_path(tmp_dir()) | ||
.run(); | ||
} | ||
|
||
run("foo"); | ||
remove_file(dynamic_lib("foo")).unwrap(); | ||
|
||
rustc().input("foo.rs").arg("-Clto").run(); | ||
run("foo"); | ||
} |