Hash :
ea60af6c
Author :
Date :
2015-07-09T09:38:05
Added winrt project generation to gclient sync BUG=angleproject:1057 Change-Id: Ic52c385cb19f6ddccaf3d46a88a56670da0cf67d Reviewed-on: https://chromium-review.googlesource.com/283987 Tested-by: Cooper Partin <coopp@microsoft.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
#!/usr/bin/python
# Copyright (c) 2010 The ANGLE Project Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This script is wrapper for ANGLE that adds some support for how GYP
# is invoked by ANGLE beyond what can be done in the gclient hooks.
import os
import sys
script_dir = os.path.dirname(__file__)
angle_dir = os.path.normpath(os.path.join(script_dir, os.pardir))
sys.path.append(os.path.join(angle_dir, 'third_party', 'gyp', 'pylib'))
import gyp
def appendCommonArgs(args):
# Set the depth to get the top-level Makefile generated into the
# correct directory. This only has an effect on Linux.
args.append('--depth');
args.append('.');
# Add standalone.gypi to the include path to set required
# variables that are otherwise picked up from Chromium's gyp
# files.
args.append('-I' + os.path.join(script_dir, 'standalone.gypi'))
# Add common.gypi to the include path.
args.append('-I' + os.path.join(script_dir, 'common.gypi'))
args.append('--no-parallel')
# Indicate ANGLE is being built standalone (as opposed to within
# a Chromium workspace).
args.append('-Dangle_standalone=1')
def generateProjects(generate_args):
args = generate_args
appendCommonArgs(args)
# Add all.gyp as the main gyp file to be generated.
args.append(os.path.join(script_dir, 'ANGLE.gyp'))
gyp.main(args)
def generateWinRTProjects(generate_args, generation_dir, build_winphone, msvs_version, app_type_rev):
args = generate_args
appendCommonArgs(args)
args.append('--ignore-environment')
args.append('--generator-output=' + generation_dir)
args.append('--format=msvs')
args.append('-Gmsvs_version=' + msvs_version)
args.append('-Dangle_use_commit_id=1')
args.append('-Dangle_build_winrt=1')
args.append('-Dangle_build_winrt_app_type_revision=' + app_type_rev)
args.append('-Dangle_build_winphone=' + ('1' if build_winphone else '0'))
args.append('-Dangle_enable_d3d9=0')
args.append('-Dangle_enable_gl=0')
# Add all.gyp as the main gyp file to be generated.
args.append(os.path.join(script_dir, 'ANGLE.gyp'))
print 'Generating WinRT projects to ' + generation_dir + ' from gyp files...'
sys.stdout.flush()
gyp.main(args)
if __name__ == '__main__':
print 'Updating projects from gyp files...'
sys.stdout.flush()
# Generate projects
args = sys.argv[1:]
generateProjects(args)
# Generate WinRT projects only if configured
if 'GYP_GENERATE_WINRT' in os.environ:
# Generate Windows 8.1 projects
args = sys.argv[1:]
generateWinRTProjects(args, "winrt/8.1/windows", False, "2013e", "8.1");
args = sys.argv[1:]
generateWinRTProjects(args, "winrt/8.1/windowsphone", True, "2013e", "8.1");
# Generate Windows 10 projects
args = sys.argv[1:]
generateWinRTProjects(args, "winrt/10", False, "2015", "8.2");