Upstream version 5.34.92.0
[platform/framework/web/crosswalk.git] / src / third_party / angle / generate_projects
1 #!/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
12 import os
13 import sys
14
15 script_dir = os.path.join(os.path.dirname(__file__), 'build')
16 angle_dir = os.path.normpath(os.path.join(script_dir, os.pardir))
17 gyp_dir = os.path.join(angle_dir, 'third_party', 'gyp')
18
19 generation_dir = "projects"
20 gyp_generators = "msvs"
21 msvs_version = "2010e"
22 build_samples = True
23 build_tests = False
24
25 if __name__ == '__main__':
26         gyp_cmd = os.path.join(gyp_dir, 'gyp')
27         gyp_cmd += ' --ignore-environment'
28         gyp_cmd += ' --depth=.'
29         gyp_cmd += ' --include=' + os.path.join(script_dir, 'common.gypi')
30         gyp_cmd += ' --generator-output=' + generation_dir
31         gyp_cmd += ' --format=' + gyp_generators
32         gyp_cmd += ' -G msvs_version=' + msvs_version
33         gyp_cmd += ' -D angle_build_tests=' + ('1' if build_tests else '0')
34         gyp_cmd += ' -D angle_build_samples=' + ('1' if build_samples else '0')
35         gyp_cmd += ' -D angle_relative_src_path=..\\..\\src\\'
36         gyp_cmd += ' ' + os.path.join(script_dir, 'all.gyp')
37
38         print 'Generating projects to ' + generation_dir + ' from gyp files...'
39         print gyp_cmd
40         sys.stdout.flush()
41         os.system(gyp_cmd)
42
43         git_add_cmd = 'git add ' + generation_dir + ' -u'
44         print '\nRunning git add on updated Visual Studio projects...'
45         print git_add_cmd
46         sys.stdout.flush()
47         os.system(git_add_cmd)