Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(240)

Side by Side Diff: pylib/gyp/msvs_emulation.py

Issue 25757002: Refactor calculation of variables, common to many generators. (Closed) Base URL: http://gyp.googlecode.com/svn/trunk
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pylib/gyp/generator/ninja.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012 Google Inc. All rights reserved. 1 # Copyright (c) 2012 Google Inc. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """ 5 """
6 This module helps emulate Visual Studio 2008 behavior on top of other 6 This module helps emulate Visual Studio 2008 behavior on top of other
7 build systems, primarily ninja. 7 build systems, primarily ninja.
8 """ 8 """
9 9
10 import os 10 import os
(...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after
841 so they're not surprised when the VS build fails.""" 841 so they're not surprised when the VS build fails."""
842 if int(generator_flags.get('msvs_error_on_missing_sources', 0)): 842 if int(generator_flags.get('msvs_error_on_missing_sources', 0)):
843 no_specials = filter(lambda x: '$' not in x, sources) 843 no_specials = filter(lambda x: '$' not in x, sources)
844 relative = [os.path.join(build_dir, gyp_to_ninja(s)) for s in no_specials] 844 relative = [os.path.join(build_dir, gyp_to_ninja(s)) for s in no_specials]
845 missing = filter(lambda x: not os.path.exists(x), relative) 845 missing = filter(lambda x: not os.path.exists(x), relative)
846 if missing: 846 if missing:
847 # They'll look like out\Release\..\..\stuff\things.cc, so normalize the 847 # They'll look like out\Release\..\..\stuff\things.cc, so normalize the
848 # path for a slightly less crazy looking output. 848 # path for a slightly less crazy looking output.
849 cleaned_up = [os.path.normpath(x) for x in missing] 849 cleaned_up = [os.path.normpath(x) for x in missing]
850 raise Exception('Missing input files:\n%s' % '\n'.join(cleaned_up)) 850 raise Exception('Missing input files:\n%s' % '\n'.join(cleaned_up))
851
852 # Sets some values in default_variables, which are required for many
853 # generators, run on Windows.
854 def CalculateCommonVariables(default_variables, params):
855 generator_flags = params.get('generator_flags', {})
856
857 # Set a variable so conditions can be based on msvs_version.
858 msvs_version = gyp.msvs_emulation.GetVSVersion(generator_flags)
859 default_variables['MSVS_VERSION'] = msvs_version.ShortName()
860
861 # To determine processor word size on Windows, in addition to checking
862 # PROCESSOR_ARCHITECTURE (which reflects the word size of the current
863 # process), it is also necessary to check PROCESSOR_ARCHITEW6432 (which
864 # contains the actual word size of the system when running thru WOW64).
865 if ('64' in os.environ.get('PROCESSOR_ARCHITECTURE', '') or
866 '64' in os.environ.get('PROCESSOR_ARCHITEW6432', '')):
867 default_variables['MSVS_OS_BITS'] = 64
868 else:
869 default_variables['MSVS_OS_BITS'] = 32
OLDNEW
« no previous file with comments | « pylib/gyp/generator/ninja.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698