OLD | NEW |
---|---|
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 import copy | 5 import copy |
6 import ntpath | 6 import ntpath |
7 import os | 7 import os |
8 import posixpath | 8 import posixpath |
9 import re | 9 import re |
10 import subprocess | 10 import subprocess |
(...skipping 1643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1654 | 1654 |
1655 # Select project file format version (if unset, default to auto detecting). | 1655 # Select project file format version (if unset, default to auto detecting). |
1656 msvs_version = MSVSVersion.SelectVisualStudioVersion( | 1656 msvs_version = MSVSVersion.SelectVisualStudioVersion( |
1657 generator_flags.get('msvs_version', 'auto')) | 1657 generator_flags.get('msvs_version', 'auto')) |
1658 # Stash msvs_version for later (so we don't have to probe the system twice). | 1658 # Stash msvs_version for later (so we don't have to probe the system twice). |
1659 params['msvs_version'] = msvs_version | 1659 params['msvs_version'] = msvs_version |
1660 | 1660 |
1661 # Set a variable so conditions can be based on msvs_version. | 1661 # Set a variable so conditions can be based on msvs_version. |
1662 default_variables['MSVS_VERSION'] = msvs_version.ShortName() | 1662 default_variables['MSVS_VERSION'] = msvs_version.ShortName() |
1663 | 1663 |
1664 # Use the platform toolset specified in the environment (MSBuild only) | |
1665 msvs_toolset = generator_flags.get( | |
1666 'msvs_toolset', os.environ.get('GYP_MSVS_TOOLSET', 'auto')) | |
1667 generator_flags['msvs_toolset'] = msvs_toolset | |
1668 | |
1664 # To determine processor word size on Windows, in addition to checking | 1669 # To determine processor word size on Windows, in addition to checking |
1665 # PROCESSOR_ARCHITECTURE (which reflects the word size of the current | 1670 # PROCESSOR_ARCHITECTURE (which reflects the word size of the current |
1666 # process), it is also necessary to check PROCESSOR_ARCITEW6432 (which | 1671 # process), it is also necessary to check PROCESSOR_ARCITEW6432 (which |
1667 # contains the actual word size of the system when running thru WOW64). | 1672 # contains the actual word size of the system when running thru WOW64). |
1668 if (os.environ.get('PROCESSOR_ARCHITECTURE', '').find('64') >= 0 or | 1673 if (os.environ.get('PROCESSOR_ARCHITECTURE', '').find('64') >= 0 or |
1669 os.environ.get('PROCESSOR_ARCHITEW6432', '').find('64') >= 0): | 1674 os.environ.get('PROCESSOR_ARCHITEW6432', '').find('64') >= 0): |
1670 default_variables['MSVS_OS_BITS'] = 64 | 1675 default_variables['MSVS_OS_BITS'] = 64 |
1671 else: | 1676 else: |
1672 default_variables['MSVS_OS_BITS'] = 32 | 1677 default_variables['MSVS_OS_BITS'] = 32 |
1673 | 1678 |
(...skipping 1153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2827 'Project', | 2832 'Project', |
2828 {'xmlns': 'http://schemas.microsoft.com/developer/msbuild/2003', | 2833 {'xmlns': 'http://schemas.microsoft.com/developer/msbuild/2003', |
2829 'ToolsVersion': version.ProjectVersion(), | 2834 'ToolsVersion': version.ProjectVersion(), |
2830 'DefaultTargets': 'Build' | 2835 'DefaultTargets': 'Build' |
2831 }] | 2836 }] |
2832 | 2837 |
2833 content += _GetMSBuildProjectConfigurations(configurations) | 2838 content += _GetMSBuildProjectConfigurations(configurations) |
2834 content += _GetMSBuildGlobalProperties(spec, project.guid, project_file_name) | 2839 content += _GetMSBuildGlobalProperties(spec, project.guid, project_file_name) |
2835 content += import_default_section | 2840 content += import_default_section |
2836 content += _GetMSBuildConfigurationDetails(spec, project.build_file) | 2841 content += _GetMSBuildConfigurationDetails(spec, project.build_file) |
2842 | |
2843 # Specify a platform toolset for the project if set. | |
2844 msvs_toolset = generator_flags.get('msvs_toolset', 'auto') | |
bradn
2012/02/15 06:23:17
Rather than having this be a generator flag, could
alexeypa (please no reviews)
2012/02/17 18:11:40
This certainly makes sense. Take a look at the upd
| |
2845 if msvs_toolset != 'auto': | |
2846 content += [ | |
2847 ['PropertyGroup', {'Label': 'Locals'}, | |
2848 ['PlatformToolset', msvs_toolset], | |
2849 ]] | |
2850 | |
2837 content += import_cpp_props_section | 2851 content += import_cpp_props_section |
2838 content += _GetMSBuildExtensions(props_files_of_rules) | 2852 content += _GetMSBuildExtensions(props_files_of_rules) |
2839 content += _GetMSBuildPropertySheets(configurations) | 2853 content += _GetMSBuildPropertySheets(configurations) |
2840 content += macro_section | 2854 content += macro_section |
2841 content += _GetMSBuildConfigurationGlobalProperties(spec, configurations, | 2855 content += _GetMSBuildConfigurationGlobalProperties(spec, configurations, |
2842 project.build_file) | 2856 project.build_file) |
2843 content += _GetMSBuildToolSettingsSections(spec, configurations) | 2857 content += _GetMSBuildToolSettingsSections(spec, configurations) |
2844 content += _GetMSBuildSources( | 2858 content += _GetMSBuildSources( |
2845 spec, sources, exclusions, extension_to_rule_name, actions_spec, | 2859 spec, sources, exclusions, extension_to_rule_name, actions_spec, |
2846 sources_handled_by_action, list_excluded) | 2860 sources_handled_by_action, list_excluded) |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2926 action_spec.extend( | 2940 action_spec.extend( |
2927 # TODO(jeanluc) 'Document' for all or just if as_sources? | 2941 # TODO(jeanluc) 'Document' for all or just if as_sources? |
2928 [['FileType', 'Document'], | 2942 [['FileType', 'Document'], |
2929 ['Command', command], | 2943 ['Command', command], |
2930 ['Message', description], | 2944 ['Message', description], |
2931 ['Outputs', outputs] | 2945 ['Outputs', outputs] |
2932 ]) | 2946 ]) |
2933 if additional_inputs: | 2947 if additional_inputs: |
2934 action_spec.append(['AdditionalInputs', additional_inputs]) | 2948 action_spec.append(['AdditionalInputs', additional_inputs]) |
2935 actions_spec.append(action_spec) | 2949 actions_spec.append(action_spec) |
OLD | NEW |