return an error if no VS or MSVC is found
authorMatthew Leibowitz <mattleibow@live.com>
Mon, 28 Aug 2017 20:57:06 +0000 (22:57 +0200)
committerMatthew Leibowitz <mattleibow@live.com>
Mon, 28 Aug 2017 20:57:06 +0000 (22:57 +0200)
gn/find_msvc_root.py
gn/find_windk.py

index e795f8d..69a3a25 100644 (file)
@@ -15,10 +15,8 @@ if msvc == 2015:
   print windk + '/VC'
 else:
   # get the first version
-  dir = os.listdir(windk + '/VC/Tools/MSVC/')[0]
-  if os.path.exists(dir):
-    print dir
+  root = windk + '/VC/Tools/MSVC/'
+  for vc_dir in os.listdir(root):
+    print root + vc_dir
     sys.exit(0)
-  # fallback to a version
-  vc_version = '14.11.25503'
-  print windk + '/VC/Tools/MSVC/' + vc_version
+  sys.exit(1)
index d90a613..4489464 100644 (file)
@@ -26,5 +26,4 @@ else:
     if os.path.exists(root + edition):
       print root + edition
       sys.exit(0)
-  # fall back to the "default"
-  print 'C:/Program Files (x86)/Microsoft Visual Studio/2017/' + editions[0]
+  sys.exit(1)