about summary refs log tree commit diff
path: root/src/etc
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2016-07-25 15:37:12 -0700
committerJan-Erik Rediger <janerik@fnordig.de>2016-07-29 10:29:59 +0200
commit0509be1f6bc48da753d7383275d3c39591f3650c (patch)
treee842e8368d4b2f3763560bdac94b7746940d508f /src/etc
parent75bcda4cf1c2d16bda20d1efb0c87b227d973180 (diff)
Update parsing llvm-config output
Now it prints full paths on MSVC, but we're only interested in path names
Diffstat (limited to 'src/etc')
-rw-r--r--src/etc/mklldeps.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/etc/mklldeps.py b/src/etc/mklldeps.py
index 8381e4f7040..24b007576aa 100644
--- a/src/etc/mklldeps.py
+++ b/src/etc/mklldeps.py
@@ -77,6 +77,13 @@ for lib in out.strip().replace("\n", ' ').split(' '):
         lib = lib.strip()[2:]
     elif lib[0] == '-':
         lib = lib.strip()[1:]
+    # If this actually points at a literal file then we're on MSVC which now
+    # prints full paths, so get just the name of the library and strip off the
+    # trailing ".lib"
+    elif os.path.exists(lib):
+        lib = os.path.basename(lib)[:-4]
+    elif lib[-4:] == '.lib':
+        lib = lib[:-4]
     f.write("#[link(name = \"" + lib + "\"")
     if not llvm_shared and 'LLVM' in lib:
         f.write(", kind = \"static\"")