[lit] On Windows, don't error if MSVC is not in PATH.
authorZachary Turner <zturner@google.com>
Mon, 19 Nov 2018 16:47:06 +0000 (16:47 +0000)
committerZachary Turner <zturner@google.com>
Mon, 19 Nov 2018 16:47:06 +0000 (16:47 +0000)
We had some logic backwards, and as a result if MSVC was not found
in PATH we would throw a string concatenation exception.

llvm-svn: 347224

lldb/lit/helper/toolchain.py

index 7aa5d0e..ce22c25 100644 (file)
@@ -42,12 +42,14 @@ def _use_msvc_substitutions(config):
     # If running from a Visual Studio Command prompt (e.g. vcvars), this will
     # detect the include and lib paths, and find cl.exe and link.exe and create
     # substitutions for each of them that explicitly specify /I and /L paths
-    cl = '"' + lit.util.which('cl') + '"'
-    link = '"' + lit.util.which('link') + '"'
+    cl = lit.util.which('cl')
+    link = lit.util.which('link')
 
     if not cl or not link:
         return
 
+    cl = '"' + cl + '"'
+    link = '"' + link + '"'
     includes = os.getenv('INCLUDE', '').split(';')
     libs = os.getenv('LIB', '').split(';')