aboutsummaryrefslogtreecommitdiff
path: root/src/link.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2017-09-23 13:03:25 -0400
committerAndrew Kelley <superjoe30@gmail.com>2017-09-23 13:03:25 -0400
commitd71d6363ce15b7bb7b66efad2cb62dfa79045e80 (patch)
tree25f9e27f829da5e5606db1ac81227ebd29edbaf3 /src/link.cpp
parent10fa51a085d1312c313b7669ce87533bd7b4c406 (diff)
downloadzig-d71d6363ce15b7bb7b66efad2cb62dfa79045e80.tar.gz
zig-d71d6363ce15b7bb7b66efad2cb62dfa79045e80.zip
macho linking: support full lib paths correctly
Diffstat (limited to 'src/link.cpp')
-rw-r--r--src/link.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/link.cpp b/src/link.cpp
index 0ee0b49d01..39cadaea0f 100644
--- a/src/link.cpp
+++ b/src/link.cpp
@@ -757,8 +757,12 @@ static void construct_linker_job_macho(LinkJob *lj) {
// so we always link against libSystem
lj->args.append("-lSystem");
} else {
- Buf *arg = buf_sprintf("-l%s", buf_ptr(link_lib->name));
- lj->args.append(buf_ptr(arg));
+ if (strchr(buf_ptr(link_lib->name), '/') == nullptr) {
+ Buf *arg = buf_sprintf("-l%s", buf_ptr(link_lib->name));
+ lj->args.append(buf_ptr(arg));
+ } else {
+ lj->args.append(buf_ptr(link_lib->name));
+ }
}
}
} else {