return an error if no VS or MSVC is found
[platform/upstream/libSkiaSharp.git] / gn / find_msvc_root.py
1 #!/usr/bin/env python
2 #
3 # Copyright 2016 Google Inc.
4 #
5 # Use of this source code is governed by a BSD-style license that can be
6 # found in the LICENSE file.
7
8 import os
9 import sys
10
11 msvc = int(sys.argv[1])
12 windk = sys.argv[2]
13
14 if msvc == 2015:
15   print windk + '/VC'
16 else:
17   # get the first version
18   root = windk + '/VC/Tools/MSVC/'
19   for vc_dir in os.listdir(root):
20     print root + vc_dir
21     sys.exit(0)
22   sys.exit(1)