]> git.proxmox.com Git - cargo.git/commitdiff
Pass link args to dependents.
authorMarkus Reiter <me@reitermark.us>
Fri, 24 Jul 2020 06:55:12 +0000 (08:55 +0200)
committerMarkus Reiter <me@reitermark.us>
Mon, 9 Nov 2020 14:16:32 +0000 (15:16 +0100)
src/cargo/core/compiler/mod.rs

index e0181a2cb3951c8203b0a6864b61abf33df19130..4b1ed821748b079d030b87ecda6adc0c68e25b02 100644 (file)
@@ -357,6 +357,7 @@ fn rustc(cx: &mut Context<'_, '_>, unit: &Unit, exec: &Arc<dyn Executor>) -> Car
             for path in output.library_paths.iter() {
                 rustc.arg("-L").arg(path);
             }
+
             if key.0 == current_id {
                 for cfg in &output.cfgs {
                     rustc.arg("--cfg").arg(cfg);
@@ -366,11 +367,12 @@ fn rustc(cx: &mut Context<'_, '_>, unit: &Unit, exec: &Arc<dyn Executor>) -> Car
                         rustc.arg("-l").arg(name);
                     }
                 }
-                if link_type.is_some() {
-                    for (lt, arg) in &output.linker_args {
-                        if lt.is_none() || *lt == link_type {
-                            rustc.arg("-C").arg(format!("link-arg={}", arg));
-                        }
+            }
+
+            if link_type.is_some() {
+                for (lt, arg) in &output.linker_args {
+                    if lt.is_none() || *lt == link_type {
+                        rustc.arg("-C").arg(format!("link-arg={}", arg));
                     }
                 }
             }