blob: ffcaafbd2e8e6d13590ea75ef66a7cbfddda36dc [file] [log] [blame]
Geoff Lang2b8f6fb2013-10-21 13:35:39 -04001#!/usr/bin/python
2
3# Copyright (c) 2013 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# This script regenerates the canonical visual studio project files that
8# are distributed with the ANGLE repository. It requires that depot_tools
9# is installed and gclient sync has been run to download gyp. The project
10# files are generated and then git added so they can be committed.
11
12import os
13import sys
14
15script_dir = os.path.join(os.path.dirname(__file__), 'build')
16angle_dir = os.path.normpath(os.path.join(script_dir, os.pardir))
17gyp_dir = os.path.join(angle_dir, 'third_party', 'gyp')
18
19generation_dir = "projects"
20gyp_generators = "msvs"
Geoff Langeb10f1c2014-08-04 11:15:34 -040021msvs_version = "2013e"
Geoff Lang2b8f6fb2013-10-21 13:35:39 -040022build_samples = True
23build_tests = False
Geoff Lang16851c82014-02-10 13:31:32 -050024release_symbols = False
Geoff Lang2b8f6fb2013-10-21 13:35:39 -040025
26if __name__ == '__main__':
Geoff Lang3cd50f72014-01-10 13:04:48 -050027 gyp_cmd = os.path.join(gyp_dir, 'gyp')
28 gyp_cmd += ' --ignore-environment'
29 gyp_cmd += ' --depth=.'
30 gyp_cmd += ' --include=' + os.path.join(script_dir, 'common.gypi')
31 gyp_cmd += ' --generator-output=' + generation_dir
32 gyp_cmd += ' --format=' + gyp_generators
33 gyp_cmd += ' -G msvs_version=' + msvs_version
34 gyp_cmd += ' -D angle_build_tests=' + ('1' if build_tests else '0')
35 gyp_cmd += ' -D angle_build_samples=' + ('1' if build_samples else '0')
Geoff Lang16851c82014-02-10 13:31:32 -050036 gyp_cmd += ' -D release_symbols=' + ('true' if release_symbols else 'false')
Jamie Madill9c4b24a2014-06-12 13:41:17 -040037 gyp_cmd += ' -D angle_use_commit_id=0'
Geoff Lang3cd50f72014-01-10 13:04:48 -050038 gyp_cmd += ' ' + os.path.join(script_dir, 'all.gyp')
Geoff Lang2b8f6fb2013-10-21 13:35:39 -040039
Geoff Lang3cd50f72014-01-10 13:04:48 -050040 print 'Generating projects to ' + generation_dir + ' from gyp files...'
41 print gyp_cmd
42 sys.stdout.flush()
43 os.system(gyp_cmd)
Geoff Lang2b8f6fb2013-10-21 13:35:39 -040044
Geoff Lang3cd50f72014-01-10 13:04:48 -050045 git_add_cmd = 'git add ' + generation_dir + ' -u'
46 print '\nRunning git add on updated Visual Studio projects...'
47 print git_add_cmd
48 sys.stdout.flush()
49 os.system(git_add_cmd)