about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/librustc/session/config.rs3
-rw-r--r--src/librustc/session/search_paths.rs3
-rw-r--r--src/librustc_trans/back/link.rs7
3 files changed, 10 insertions, 3 deletions
diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs
index 88f6dc673cf..8faf81a1564 100644
--- a/src/librustc/session/config.rs
+++ b/src/librustc/session/config.rs
@@ -738,7 +738,8 @@ pub fn rustc_short_optgroups() -> Vec<RustcOptGroup> {
     vec![
         opt::flag("h", "help", "Display this message"),
         opt::multi("", "cfg", "Configure the compilation environment", "SPEC"),
-        opt::multi("L", "",   "Add a directory to the library search path", "PATH"),
+        opt::multi("L", "",   "Add a directory to the library search path",
+                   "[KIND=]PATH"),
         opt::multi("l", "",   "Link the generated crate(s) to the specified native
                              library NAME. The optional KIND can be one of,
                              static, dylib, or framework. If omitted, dylib is
diff --git a/src/librustc/session/search_paths.rs b/src/librustc/session/search_paths.rs
index c6436d47c73..c314a999f24 100644
--- a/src/librustc/session/search_paths.rs
+++ b/src/librustc/session/search_paths.rs
@@ -25,6 +25,7 @@ pub enum PathKind {
     Native,
     Crate,
     Dependency,
+    Framework,
     ExternFlag,
     All,
 }
@@ -41,6 +42,8 @@ impl SearchPaths {
             (PathKind::Crate, &path["crate=".len()..])
         } else if path.starts_with("dependency=") {
             (PathKind::Dependency, &path["dependency=".len()..])
+        } else if path.starts_with("framework=") {
+            (PathKind::Framework, &path["framework=".len()..])
         } else if path.starts_with("all=") {
             (PathKind::All, &path["all=".len()..])
         } else {
diff --git a/src/librustc_trans/back/link.rs b/src/librustc_trans/back/link.rs
index f841b6cf494..792178e970c 100644
--- a/src/librustc_trans/back/link.rs
+++ b/src/librustc_trans/back/link.rs
@@ -1044,8 +1044,11 @@ fn link_args(cmd: &mut Command,
 // in the current crate. Upstream crates with native library dependencies
 // may have their native library pulled in above.
 fn add_local_native_libraries(cmd: &mut Command, sess: &Session) {
-    sess.target_filesearch(PathKind::All).for_each_lib_search_path(|path, _| {
-        cmd.arg("-L").arg(path);
+    sess.target_filesearch(PathKind::All).for_each_lib_search_path(|path, k| {
+        match k {
+            PathKind::Framework => { cmd.arg("-F").arg(path); }
+            _ => { cmd.arg("-L").arg(path); }
+        }
         FileDoesntMatch
     });