blob: 08d627738ada43f405c81d28cccd8cd007fb836b [file] [log] [blame]
Frank Henigmandda048c2018-01-11 20:09:09 -05001#!/usr/bin/python2
Jamie Madill54118be2017-10-24 09:20:14 -04002#
3# Copyright 2017 The ANGLE Project Authors. All rights reserved.
4# Use of this source code is governed by a BSD-style license that can be
5# found in the LICENSE file.
6#
7# msvs_projects.py:
8# A helper utility that generates Visual Studio projects for each of
9# the available directories in 'out', and then runs another helper
10# utility that merges these projects into one solution.
11
12import sys, os, subprocess
13
14# Change this to target another VS version.
15target_ide = 'vs2017'
16solution_name = 'ANGLE'
17
18script_dir = os.path.dirname(sys.argv[0])
19
20# Set the CWD to the root ANGLE folder.
21os.chdir(os.path.join(script_dir, '..'))
22
23out_dir = 'out'
24
25# Generate the VS solutions for any valid directory.
26def generate_projects(dirname):
27 args = ['gn.bat', 'gen', dirname, '--ide=' + target_ide, '--sln=' + solution_name]
28 print('Running "' + ' '.join(args) + '"')
29 subprocess.call(args)
30
31for potential_dir in os.listdir(out_dir):
32 path = os.path.join(out_dir, potential_dir)
33 build_ninja_d = os.path.join(path, 'build.ninja.d')
34 if os.path.exists(build_ninja_d):
35 generate_projects(path)
36
37# Run the helper utility that merges the projects.
38args = ['python', os.path.join('build', 'win', 'gn_meta_sln.py')]
39print('Running "' + ' '.join(args) + '"')
Frank Henigmandda048c2018-01-11 20:09:09 -050040subprocess.call(args)