Edit

kc3-lang/angle/build/gyp_angle

Branch :

  • Show log

    Commit

  • Author : Cooper Partin
    Date : 2015-07-09 09:38:05
    Hash : ea60af6c
    Message : 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>

  • build/gyp_angle
  • #!/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");