Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/angle
Path: blob/main_old/scripts/msvs_projects.py
1693 views
1
#!/usr/bin/python2
2
#
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
12
import sys, os, subprocess
13
14
# Change this to target another VS version.
15
target_ide = 'vs2017'
16
solution_name = 'ANGLE'
17
18
script_dir = os.path.dirname(sys.argv[0])
19
20
# Set the CWD to the root ANGLE folder.
21
os.chdir(os.path.join(script_dir, '..'))
22
23
out_dir = 'out'
24
25
26
# Generate the VS solutions for any valid directory.
27
def generate_projects(dirname):
28
args = ['gn.bat', 'gen', dirname, '--ide=' + target_ide, '--sln=' + solution_name]
29
print('Running "' + ' '.join(args) + '"')
30
subprocess.call(args)
31
32
33
for potential_dir in os.listdir(out_dir):
34
path = os.path.join(out_dir, potential_dir)
35
build_ninja_d = os.path.join(path, 'build.ninja.d')
36
if os.path.exists(build_ninja_d):
37
generate_projects(path)
38
39
# Run the helper utility that merges the projects.
40
args = ['python', os.path.join('build', 'win', 'gn_meta_sln.py')]
41
print('Running "' + ' '.join(args) + '"')
42
subprocess.call(args)
43
44