forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#126898 - GuillaumeGomez:migrate-run-make-link…
…-framework, r=<try> Migrate `run-make/link-framework` to `rmake.rs` Part of rust-lang#121876. r? `@Kobzol` try-job: x86_64-apple-1
- Loading branch information
Showing
3 changed files
with
39 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,39 @@ | ||
// Check that linking to a framework actually makes it to the linker. | ||
|
||
//@ only-apple | ||
|
||
use run_make_support::{cmd, cwd, rustc, shallow_find_files}; | ||
|
||
fn main() { | ||
rustc().input("dep-link-framework.rs").run(); | ||
rustc().input("dep-link-weak-framework.rs").run(); | ||
|
||
rustc().input("empty.rs").run(); | ||
eprintln!("---> {:?}", shallow_find_files(cwd(), |_| true)); | ||
cmd("otool").arg("-L").arg("no-link").run().assert_stdout_not_contains("CoreFoundation"); | ||
|
||
rustc().input("link-framework.rs").run(); | ||
let out = cmd("otool") | ||
.arg("-L") | ||
.arg("link-framework") | ||
.run() | ||
.assert_stdout_contains("CoreFoundation") | ||
.assert_stdout_not_contains("weak"); | ||
|
||
rustc().input("link-weak-framework.rs").run(); | ||
let out = cmd("otool") | ||
.arg("-L") | ||
.arg("link-weak-framework") | ||
.run() | ||
.assert_stdout_contains("CoreFoundation") | ||
.assert_stdout_contains("weak"); | ||
|
||
// When linking the framework both normally, and weakly, the weak linking takes preference. | ||
rustc().input("link-both.rs").run(); | ||
let out = cmd("otool") | ||
.arg("-L") | ||
.arg("link-both") | ||
.run() | ||
.assert_stdout_contains("CoreFoundation") | ||
.assert_stdout_contains("weak"); | ||
} |