Edit

kc3-lang/angle/scripts/msvs_projects.py

Branch :

  • Show log

    Commit

  • Author : Frank Henigman
    Date : 2018-01-11 20:09:09
    Hash : dda048cd
    Message : Make scripts executable by python2. Add #!/usr/bin/python2 and the executable permission bit to all scripts where missing. BUG=angleproject:2209 Change-Id: Ib33017c17e579c371b89bbfbdb7136b870027dc5 Reviewed-on: https://chromium-review.googlesource.com/862987 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Frank Henigman <fjhenigman@chromium.org>

  • scripts/msvs_projects.py
  • #!/usr/bin/python2
    #
    # Copyright 2017 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.
    #
    # msvs_projects.py:
    #   A helper utility that generates Visual Studio projects for each of
    #   the available directories in 'out', and then runs another helper
    #   utility that merges these projects into one solution.
    
    import sys, os, subprocess
    
    # Change this to target another VS version.
    target_ide = 'vs2017'
    solution_name = 'ANGLE'
    
    script_dir = os.path.dirname(sys.argv[0])
    
    # Set the CWD to the root ANGLE folder.
    os.chdir(os.path.join(script_dir, '..'))
    
    out_dir = 'out'
    
    # Generate the VS solutions for any valid directory.
    def generate_projects(dirname):
        args = ['gn.bat', 'gen', dirname, '--ide=' + target_ide, '--sln=' + solution_name]
        print('Running "' + ' '.join(args) + '"')
        subprocess.call(args)
    
    for potential_dir in os.listdir(out_dir):
        path = os.path.join(out_dir, potential_dir)
        build_ninja_d = os.path.join(path, 'build.ninja.d')
        if os.path.exists(build_ninja_d):
            generate_projects(path)
    
    # Run the helper utility that merges the projects.
    args = ['python', os.path.join('build', 'win', 'gn_meta_sln.py')]
    print('Running "' + ' '.join(args) + '"')
    subprocess.call(args)