File tree 1 file changed +24
-2
lines changed
1 file changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -5828,6 +5828,25 @@ fn links_overrides_with_target_applies_to_host() {
5828
5828
. with_status ( 0 )
5829
5829
. run ( ) ;
5830
5830
5831
+ // The name is different on windows because ".dll" is not automatically
5832
+ // appenended like the extension on other OSes is, despite being needed.
5833
+
5834
+ // The path is different on windows because we need the "name.dll.lib" file
5835
+ // to link to it, and as per #3934 that only lives in `target/{profile}/deps`
5836
+ // and isn't copied to `target/{profile}` like the .dll is. #3951 removed the
5837
+ // hash mentioned in #3934 but did not change the directory of the .lib file.
5838
+
5839
+ // Meanwhile on other operating systems everything we need to link (which is
5840
+ // just the linux .so/the macos .dylib) is copied to `target/{profile}` from
5841
+ // `deps` and as the blessed output artifact that seems to be the appropriate
5842
+ // version to use.
5843
+ let mylib_name = if cfg ! ( windows) { "mylib.dll" } else { "mylib" } ;
5844
+ let mylib_path = if cfg ! ( windows) {
5845
+ "mylib-c/target/debug/deps"
5846
+ } else {
5847
+ "mylib-c/target/debug"
5848
+ } ;
5849
+
5831
5850
p. cargo ( "build" )
5832
5851
. masquerade_as_nightly_cargo ( & [ "target-applies-to-host" ] )
5833
5852
. args ( & [
@@ -5837,10 +5856,13 @@ fn links_overrides_with_target_applies_to_host() {
5837
5856
] )
5838
5857
. args ( & [
5839
5858
"--config" ,
5840
- & format ! ( r#"target.{}.mylib.rustc-link-lib=["mylib"]"# , rustc_host( ) ) ,
5859
+ & format ! (
5860
+ r#"target.{}.mylib.rustc-link-lib=["{mylib_name}"]"# ,
5861
+ rustc_host( )
5862
+ ) ,
5841
5863
"--config" ,
5842
5864
& format ! (
5843
- r#"target.{}.mylib.rustc-link-search=["mylib-c/target/debug "]"# ,
5865
+ r#"target.{}.mylib.rustc-link-search=["{mylib_path} "]"# ,
5844
5866
rustc_host( )
5845
5867
) ,
5846
5868
] )
You can’t perform that action at this time.
0 commit comments