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 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1031 MSVSSettings.ValidateMSVSSettings(msvs_settings) | 1031 MSVSSettings.ValidateMSVSSettings(msvs_settings) |
1032 for tool in msvs_settings: | 1032 for tool in msvs_settings: |
1033 settings = config['msvs_settings'][tool] | 1033 settings = config['msvs_settings'][tool] |
1034 for setting in settings: | 1034 for setting in settings: |
1035 _ToolAppend(tools, tool, setting, settings[setting]) | 1035 _ToolAppend(tools, tool, setting, settings[setting]) |
1036 # Add the information to the appropriate tool | 1036 # Add the information to the appropriate tool |
1037 _ToolAppend(tools, 'VCCLCompilerTool', | 1037 _ToolAppend(tools, 'VCCLCompilerTool', |
1038 'AdditionalIncludeDirectories', include_dirs) | 1038 'AdditionalIncludeDirectories', include_dirs) |
1039 _ToolAppend(tools, 'VCResourceCompilerTool', | 1039 _ToolAppend(tools, 'VCResourceCompilerTool', |
1040 'AdditionalIncludeDirectories', resource_include_dirs) | 1040 'AdditionalIncludeDirectories', resource_include_dirs) |
1041 _ToolAppend(tools, 'VCMIDLTool', | |
1042 'AdditionalIncludeDirectories', include_dirs) | |
1043 # Add in libraries. | 1041 # Add in libraries. |
1044 _ToolAppend(tools, 'VCLinkerTool', 'AdditionalDependencies', libraries) | 1042 _ToolAppend(tools, 'VCLinkerTool', 'AdditionalDependencies', libraries) |
1045 if out_file: | 1043 if out_file: |
1046 _ToolAppend(tools, vc_tool, 'OutputFile', out_file, only_if_unset=True) | 1044 _ToolAppend(tools, vc_tool, 'OutputFile', out_file, only_if_unset=True) |
1047 # Add defines. | 1045 # Add defines. |
1048 _ToolAppend(tools, 'VCCLCompilerTool', 'PreprocessorDefinitions', defines) | 1046 _ToolAppend(tools, 'VCCLCompilerTool', 'PreprocessorDefinitions', defines) |
1049 _ToolAppend(tools, 'VCResourceCompilerTool', 'PreprocessorDefinitions', | 1047 _ToolAppend(tools, 'VCResourceCompilerTool', 'PreprocessorDefinitions', |
1050 defines) | 1048 defines) |
1051 _ToolAppend(tools, 'VCMIDLTool', 'PreprocessorDefinitions', defines) | |
1052 # Change program database directory to prevent collisions. | 1049 # Change program database directory to prevent collisions. |
1053 _ToolAppend(tools, 'VCCLCompilerTool', 'ProgramDataBaseFileName', | 1050 _ToolAppend(tools, 'VCCLCompilerTool', 'ProgramDataBaseFileName', |
1054 '$(IntDir)\\$(ProjectName)\\vc80.pdb', only_if_unset=True) | 1051 '$(IntDir)\\$(ProjectName)\\vc80.pdb', only_if_unset=True) |
1055 # Add disabled warnings. | 1052 # Add disabled warnings. |
1056 _ToolAppend(tools, 'VCCLCompilerTool', | 1053 _ToolAppend(tools, 'VCCLCompilerTool', |
1057 'DisableSpecificWarnings', disabled_warnings) | 1054 'DisableSpecificWarnings', disabled_warnings) |
1058 # Add Pre-build. | 1055 # Add Pre-build. |
1059 _ToolAppend(tools, 'VCPreBuildEventTool', 'CommandLine', prebuild) | 1056 _ToolAppend(tools, 'VCPreBuildEventTool', 'CommandLine', prebuild) |
1060 # Add Post-build. | 1057 # Add Post-build. |
1061 _ToolAppend(tools, 'VCPostBuildEventTool', 'CommandLine', postbuild) | 1058 _ToolAppend(tools, 'VCPostBuildEventTool', 'CommandLine', postbuild) |
(...skipping 1700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2762 precompiled_header = configuration.get('msvs_precompiled_header') | 2759 precompiled_header = configuration.get('msvs_precompiled_header') |
2763 | 2760 |
2764 # Add the information to the appropriate tool | 2761 # Add the information to the appropriate tool |
2765 # TODO(jeanluc) We could optimize and generate these settings only if | 2762 # TODO(jeanluc) We could optimize and generate these settings only if |
2766 # the corresponding files are found, e.g. don't generate ResourceCompile | 2763 # the corresponding files are found, e.g. don't generate ResourceCompile |
2767 # if you don't have any resources. | 2764 # if you don't have any resources. |
2768 _ToolAppend(msbuild_settings, 'ClCompile', | 2765 _ToolAppend(msbuild_settings, 'ClCompile', |
2769 'AdditionalIncludeDirectories', include_dirs) | 2766 'AdditionalIncludeDirectories', include_dirs) |
2770 _ToolAppend(msbuild_settings, 'ResourceCompile', | 2767 _ToolAppend(msbuild_settings, 'ResourceCompile', |
2771 'AdditionalIncludeDirectories', resource_include_dirs) | 2768 'AdditionalIncludeDirectories', resource_include_dirs) |
2772 _ToolAppend(msbuild_settings, 'Midl', | |
2773 'AdditionalIncludeDirectories', include_dirs) | |
2774 # Add in libraries. | 2769 # Add in libraries. |
2775 _ToolAppend(msbuild_settings, 'Link', 'AdditionalDependencies', libraries) | 2770 _ToolAppend(msbuild_settings, 'Link', 'AdditionalDependencies', libraries) |
2776 if out_file: | 2771 if out_file: |
2777 _ToolAppend(msbuild_settings, msbuild_tool, 'OutputFile', out_file, | 2772 _ToolAppend(msbuild_settings, msbuild_tool, 'OutputFile', out_file, |
2778 only_if_unset=True) | 2773 only_if_unset=True) |
2779 # Add defines. | 2774 # Add defines. |
2780 _ToolAppend(msbuild_settings, 'ClCompile', | 2775 _ToolAppend(msbuild_settings, 'ClCompile', |
2781 'PreprocessorDefinitions', defines) | 2776 'PreprocessorDefinitions', defines) |
2782 _ToolAppend(msbuild_settings, 'ResourceCompile', | 2777 _ToolAppend(msbuild_settings, 'ResourceCompile', |
2783 'PreprocessorDefinitions', defines) | 2778 'PreprocessorDefinitions', defines) |
2784 _ToolAppend(msbuild_settings, 'Midl', 'PreprocessorDefinitions', defines) | |
2785 # Add disabled warnings. | 2779 # Add disabled warnings. |
2786 _ToolAppend(msbuild_settings, 'ClCompile', | 2780 _ToolAppend(msbuild_settings, 'ClCompile', |
2787 'DisableSpecificWarnings', disabled_warnings) | 2781 'DisableSpecificWarnings', disabled_warnings) |
2788 # Turn on precompiled headers if appropriate. | 2782 # Turn on precompiled headers if appropriate. |
2789 if precompiled_header: | 2783 if precompiled_header: |
2790 precompiled_header = os.path.split(precompiled_header)[1] | 2784 precompiled_header = os.path.split(precompiled_header)[1] |
2791 _ToolAppend(msbuild_settings, 'ClCompile', 'PrecompiledHeader', 'Use') | 2785 _ToolAppend(msbuild_settings, 'ClCompile', 'PrecompiledHeader', 'Use') |
2792 _ToolAppend(msbuild_settings, 'ClCompile', | 2786 _ToolAppend(msbuild_settings, 'ClCompile', |
2793 'PrecompiledHeaderFile', precompiled_header) | 2787 'PrecompiledHeaderFile', precompiled_header) |
2794 _ToolAppend(msbuild_settings, 'ClCompile', | 2788 _ToolAppend(msbuild_settings, 'ClCompile', |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3122 action_spec.extend( | 3116 action_spec.extend( |
3123 # TODO(jeanluc) 'Document' for all or just if as_sources? | 3117 # TODO(jeanluc) 'Document' for all or just if as_sources? |
3124 [['FileType', 'Document'], | 3118 [['FileType', 'Document'], |
3125 ['Command', command], | 3119 ['Command', command], |
3126 ['Message', description], | 3120 ['Message', description], |
3127 ['Outputs', outputs] | 3121 ['Outputs', outputs] |
3128 ]) | 3122 ]) |
3129 if additional_inputs: | 3123 if additional_inputs: |
3130 action_spec.append(['AdditionalInputs', additional_inputs]) | 3124 action_spec.append(['AdditionalInputs', additional_inputs]) |
3131 actions_spec.append(action_spec) | 3125 actions_spec.append(action_spec) |
OLD | NEW |