#!/usr/bin/python21#2# Copyright 2017 The ANGLE Project Authors. All rights reserved.3# Use of this source code is governed by a BSD-style license that can be4# found in the LICENSE file.5#6# msvs_projects.py:7# A helper utility that generates Visual Studio projects for each of8# the available directories in 'out', and then runs another helper9# utility that merges these projects into one solution.1011import sys, os, subprocess1213# Change this to target another VS version.14target_ide = 'vs2017'15solution_name = 'ANGLE'1617script_dir = os.path.dirname(sys.argv[0])1819# Set the CWD to the root ANGLE folder.20os.chdir(os.path.join(script_dir, '..'))2122out_dir = 'out'232425# Generate the VS solutions for any valid directory.26def generate_projects(dirname):27args = ['gn.bat', 'gen', dirname, '--ide=' + target_ide, '--sln=' + solution_name]28print('Running "' + ' '.join(args) + '"')29subprocess.call(args)303132for potential_dir in os.listdir(out_dir):33path = os.path.join(out_dir, potential_dir)34build_ninja_d = os.path.join(path, 'build.ninja.d')35if os.path.exists(build_ninja_d):36generate_projects(path)3738# Run the helper utility that merges the projects.39args = ['python', os.path.join('build', 'win', 'gn_meta_sln.py')]40print('Running "' + ' '.join(args) + '"')41subprocess.call(args)424344