Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Correct dump_dependency_json on windows.

Fills in variables that are supplied by other generators and relied upon
by existing gyp files.

Patch by twiz@chromium.org.

git-svn-id: http://gyp.googlecode.com/svn/trunk@1506 78cadc50-ecff-11dd-a971-7dbc132099af
  • Loading branch information...
commit 25bb94a194859e03fb9a7be8e34294c412d97db9 1 parent 9f65ec7
scottmg@chromium.org authored
Showing with 27 additions and 1 deletion.
  1. +27 −1 pylib/gyp/generator/dump_dependency_json.py
View
28 pylib/gyp/generator/dump_dependency_json.py
@@ -1,10 +1,12 @@
-# Copyright (c) 2011 Google Inc. All rights reserved.
+# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import collections
+import os
import gyp
import gyp.common
+import gyp.msvs_emulation
import json
import sys
@@ -32,6 +34,30 @@ def CalculateVariables(default_variables, params):
default_variables.setdefault(key, val)
default_variables.setdefault('OS', gyp.common.GetFlavor(params))
+ flavor = gyp.common.GetFlavor(params)
+ if flavor =='win':
+ # Copy additional generator configuration data from VS, which is shared
+ # by the Windows Ninja generator.
+ import gyp.generator.msvs as msvs_generator
+ generator_additional_non_configuration_keys = getattr(msvs_generator,
+ 'generator_additional_non_configuration_keys', [])
+ generator_additional_path_sections = getattr(msvs_generator,
+ 'generator_additional_path_sections', [])
+
+ # Set a variable so conditions can be based on msvs_version.
+ msvs_version = gyp.msvs_emulation.GetVSVersion(generator_flags)
+ default_variables['MSVS_VERSION'] = msvs_version.ShortName()
+
+ # To determine processor word size on Windows, in addition to checking
+ # PROCESSOR_ARCHITECTURE (which reflects the word size of the current
+ # process), it is also necessary to check PROCESSOR_ARCHITEW6432 (which
+ # contains the actual word size of the system when running thru WOW64).
+ if ('64' in os.environ.get('PROCESSOR_ARCHITECTURE', '') or
+ '64' in os.environ.get('PROCESSOR_ARCHITEW6432', '')):
+ default_variables['MSVS_OS_BITS'] = 64
+ else:
+ default_variables['MSVS_OS_BITS'] = 32
+
def CalculateGeneratorInputInfo(params):
"""Calculate the generator specific info that gets fed to input (called by
Please sign in to comment.
Something went wrong with that request. Please try again.