wsba-hockey 1.0.3__py3-none-any.whl → 1.0.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. wsba_hockey/data_pipelines.py +183 -0
  2. wsba_hockey/evidence/weakside-breakout/node_modules/duckdb/vendor.py +146 -0
  3. wsba_hockey/evidence/weakside-breakout/node_modules/flatted/python/flatted.py +149 -0
  4. wsba_hockey/evidence/weakside-breakout/node_modules/flatted/python/test.py +63 -0
  5. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/gyp_main.py +45 -0
  6. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py +367 -0
  7. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py +206 -0
  8. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py +1270 -0
  9. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py +1547 -0
  10. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/MSVSToolFile.py +59 -0
  11. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/MSVSUserFile.py +153 -0
  12. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py +271 -0
  13. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py +574 -0
  14. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/__init__.py +690 -0
  15. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/common.py +661 -0
  16. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/common_test.py +78 -0
  17. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/easy_xml.py +165 -0
  18. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py +109 -0
  19. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/flock_tool.py +55 -0
  20. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/generator/__init__.py +0 -0
  21. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/generator/analyzer.py +808 -0
  22. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py +1173 -0
  23. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py +1321 -0
  24. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/generator/compile_commands_json.py +120 -0
  25. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py +103 -0
  26. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py +464 -0
  27. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/generator/gypd.py +89 -0
  28. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/generator/gypsh.py +58 -0
  29. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py +2714 -0
  30. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py +3981 -0
  31. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs_test.py +44 -0
  32. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py +2936 -0
  33. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py +55 -0
  34. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode.py +1394 -0
  35. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode_test.py +25 -0
  36. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/input.py +3130 -0
  37. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/input_test.py +98 -0
  38. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py +771 -0
  39. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py +1271 -0
  40. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/ninja_syntax.py +174 -0
  41. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/simple_copy.py +61 -0
  42. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/win_tool.py +374 -0
  43. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py +1939 -0
  44. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/xcode_ninja.py +302 -0
  45. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py +3197 -0
  46. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/xml_fix.py +65 -0
  47. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/test_gyp.py +261 -0
  48. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/tools/graphviz.py +102 -0
  49. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/tools/pretty_gyp.py +156 -0
  50. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/tools/pretty_sln.py +181 -0
  51. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/tools/pretty_vcproj.py +339 -0
  52. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/test/fixtures/test-charmap.py +31 -0
  53. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/update-gyp.py +64 -0
  54. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/gyp_main.py +45 -0
  55. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py +367 -0
  56. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py +206 -0
  57. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py +1270 -0
  58. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py +1547 -0
  59. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/MSVSToolFile.py +59 -0
  60. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/MSVSUserFile.py +153 -0
  61. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py +271 -0
  62. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py +574 -0
  63. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/__init__.py +666 -0
  64. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/common.py +654 -0
  65. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/common_test.py +78 -0
  66. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/easy_xml.py +165 -0
  67. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py +109 -0
  68. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/flock_tool.py +55 -0
  69. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/generator/__init__.py +0 -0
  70. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/generator/analyzer.py +808 -0
  71. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py +1173 -0
  72. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py +1321 -0
  73. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/generator/compile_commands_json.py +120 -0
  74. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py +103 -0
  75. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py +464 -0
  76. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/generator/gypd.py +89 -0
  77. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/generator/gypsh.py +58 -0
  78. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py +2518 -0
  79. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py +3978 -0
  80. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs_test.py +44 -0
  81. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py +2936 -0
  82. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py +55 -0
  83. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode.py +1394 -0
  84. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode_test.py +25 -0
  85. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/input.py +3137 -0
  86. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/input_test.py +98 -0
  87. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py +771 -0
  88. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py +1271 -0
  89. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/ninja_syntax.py +174 -0
  90. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/simple_copy.py +61 -0
  91. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/win_tool.py +374 -0
  92. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py +1939 -0
  93. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/xcode_ninja.py +302 -0
  94. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py +3197 -0
  95. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/xml_fix.py +65 -0
  96. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/setup.py +42 -0
  97. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/test_gyp.py +260 -0
  98. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/tools/graphviz.py +102 -0
  99. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/tools/pretty_gyp.py +156 -0
  100. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/tools/pretty_sln.py +181 -0
  101. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/tools/pretty_vcproj.py +339 -0
  102. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/test/fixtures/test-charmap.py +31 -0
  103. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/update-gyp.py +46 -0
  104. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/game_stats/app.py +401 -0
  105. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/game_stats/name_fix.py +47 -0
  106. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/heatmaps/app.py +108 -0
  107. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/heatmaps/plot.py +93 -0
  108. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/heatmaps/rink_plot.py +245 -0
  109. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/matchups/app.py +145 -0
  110. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/matchups/plot.py +77 -0
  111. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/matchups/rink_plot.py +245 -0
  112. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/pbp/app.py +389 -0
  113. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/pbp/plot.py +70 -0
  114. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/pbp/rink_plot.py +245 -0
  115. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/skater/app.py +110 -0
  116. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/skater/plot.py +58 -0
  117. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/skater/rink_plot.py +245 -0
  118. wsba_hockey/tools/agg.py +242 -53
  119. wsba_hockey/tools/plotting.py +12 -17
  120. wsba_hockey/tools/scraping.py +149 -258
  121. wsba_hockey/tools/xg_model.py +357 -311
  122. wsba_hockey/workspace.py +22 -117
  123. wsba_hockey/wsba_main.py +493 -165
  124. {wsba_hockey-1.0.3.dist-info → wsba_hockey-1.0.4.dist-info}/METADATA +1 -1
  125. wsba_hockey-1.0.4.dist-info/RECORD +135 -0
  126. {wsba_hockey-1.0.3.dist-info → wsba_hockey-1.0.4.dist-info}/WHEEL +1 -1
  127. wsba_hockey/stats/calculate_viz/shot_impact.py +0 -2
  128. wsba_hockey-1.0.3.dist-info/RECORD +0 -19
  129. {wsba_hockey-1.0.3.dist-info → wsba_hockey-1.0.4.dist-info}/licenses/LICENSE +0 -0
  130. {wsba_hockey-1.0.3.dist-info → wsba_hockey-1.0.4.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,1270 @@
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
3
+ # found in the LICENSE file.
4
+
5
+ r"""Code to validate and convert settings of the Microsoft build tools.
6
+
7
+ This file contains code to validate and convert settings of the Microsoft
8
+ build tools. The function ConvertToMSBuildSettings(), ValidateMSVSSettings(),
9
+ and ValidateMSBuildSettings() are the entry points.
10
+
11
+ This file was created by comparing the projects created by Visual Studio 2008
12
+ and Visual Studio 2010 for all available settings through the user interface.
13
+ The MSBuild schemas were also considered. They are typically found in the
14
+ MSBuild install directory, e.g. c:\Program Files (x86)\MSBuild
15
+ """
16
+
17
+ import re
18
+ import sys
19
+
20
+ # Dictionaries of settings validators. The key is the tool name, the value is
21
+ # a dictionary mapping setting names to validation functions.
22
+ _msvs_validators = {}
23
+ _msbuild_validators = {}
24
+
25
+
26
+ # A dictionary of settings converters. The key is the tool name, the value is
27
+ # a dictionary mapping setting names to conversion functions.
28
+ _msvs_to_msbuild_converters = {}
29
+
30
+
31
+ # Tool name mapping from MSVS to MSBuild.
32
+ _msbuild_name_of_tool = {}
33
+
34
+
35
+ class _Tool:
36
+ """Represents a tool used by MSVS or MSBuild.
37
+
38
+ Attributes:
39
+ msvs_name: The name of the tool in MSVS.
40
+ msbuild_name: The name of the tool in MSBuild.
41
+ """
42
+
43
+ def __init__(self, msvs_name, msbuild_name):
44
+ self.msvs_name = msvs_name
45
+ self.msbuild_name = msbuild_name
46
+
47
+
48
+ def _AddTool(tool):
49
+ """Adds a tool to the four dictionaries used to process settings.
50
+
51
+ This only defines the tool. Each setting also needs to be added.
52
+
53
+ Args:
54
+ tool: The _Tool object to be added.
55
+ """
56
+ _msvs_validators[tool.msvs_name] = {}
57
+ _msbuild_validators[tool.msbuild_name] = {}
58
+ _msvs_to_msbuild_converters[tool.msvs_name] = {}
59
+ _msbuild_name_of_tool[tool.msvs_name] = tool.msbuild_name
60
+
61
+
62
+ def _GetMSBuildToolSettings(msbuild_settings, tool):
63
+ """Returns an MSBuild tool dictionary. Creates it if needed."""
64
+ return msbuild_settings.setdefault(tool.msbuild_name, {})
65
+
66
+
67
+ class _Type:
68
+ """Type of settings (Base class)."""
69
+
70
+ def ValidateMSVS(self, value):
71
+ """Verifies that the value is legal for MSVS.
72
+
73
+ Args:
74
+ value: the value to check for this type.
75
+
76
+ Raises:
77
+ ValueError if value is not valid for MSVS.
78
+ """
79
+
80
+ def ValidateMSBuild(self, value):
81
+ """Verifies that the value is legal for MSBuild.
82
+
83
+ Args:
84
+ value: the value to check for this type.
85
+
86
+ Raises:
87
+ ValueError if value is not valid for MSBuild.
88
+ """
89
+
90
+ def ConvertToMSBuild(self, value):
91
+ """Returns the MSBuild equivalent of the MSVS value given.
92
+
93
+ Args:
94
+ value: the MSVS value to convert.
95
+
96
+ Returns:
97
+ the MSBuild equivalent.
98
+
99
+ Raises:
100
+ ValueError if value is not valid.
101
+ """
102
+ return value
103
+
104
+
105
+ class _String(_Type):
106
+ """A setting that's just a string."""
107
+
108
+ def ValidateMSVS(self, value):
109
+ if not isinstance(value, str):
110
+ raise ValueError("expected string; got %r" % value)
111
+
112
+ def ValidateMSBuild(self, value):
113
+ if not isinstance(value, str):
114
+ raise ValueError("expected string; got %r" % value)
115
+
116
+ def ConvertToMSBuild(self, value):
117
+ # Convert the macros
118
+ return ConvertVCMacrosToMSBuild(value)
119
+
120
+
121
+ class _StringList(_Type):
122
+ """A settings that's a list of strings."""
123
+
124
+ def ValidateMSVS(self, value):
125
+ if not isinstance(value, (list, str)):
126
+ raise ValueError("expected string list; got %r" % value)
127
+
128
+ def ValidateMSBuild(self, value):
129
+ if not isinstance(value, (list, str)):
130
+ raise ValueError("expected string list; got %r" % value)
131
+
132
+ def ConvertToMSBuild(self, value):
133
+ # Convert the macros
134
+ if isinstance(value, list):
135
+ return [ConvertVCMacrosToMSBuild(i) for i in value]
136
+ else:
137
+ return ConvertVCMacrosToMSBuild(value)
138
+
139
+
140
+ class _Boolean(_Type):
141
+ """Boolean settings, can have the values 'false' or 'true'."""
142
+
143
+ def _Validate(self, value):
144
+ if value != "true" and value != "false":
145
+ raise ValueError("expected bool; got %r" % value)
146
+
147
+ def ValidateMSVS(self, value):
148
+ self._Validate(value)
149
+
150
+ def ValidateMSBuild(self, value):
151
+ self._Validate(value)
152
+
153
+ def ConvertToMSBuild(self, value):
154
+ self._Validate(value)
155
+ return value
156
+
157
+
158
+ class _Integer(_Type):
159
+ """Integer settings."""
160
+
161
+ def __init__(self, msbuild_base=10):
162
+ _Type.__init__(self)
163
+ self._msbuild_base = msbuild_base
164
+
165
+ def ValidateMSVS(self, value):
166
+ # Try to convert, this will raise ValueError if invalid.
167
+ self.ConvertToMSBuild(value)
168
+
169
+ def ValidateMSBuild(self, value):
170
+ # Try to convert, this will raise ValueError if invalid.
171
+ int(value, self._msbuild_base)
172
+
173
+ def ConvertToMSBuild(self, value):
174
+ msbuild_format = (self._msbuild_base == 10) and "%d" or "0x%04x"
175
+ return msbuild_format % int(value)
176
+
177
+
178
+ class _Enumeration(_Type):
179
+ """Type of settings that is an enumeration.
180
+
181
+ In MSVS, the values are indexes like '0', '1', and '2'.
182
+ MSBuild uses text labels that are more representative, like 'Win32'.
183
+
184
+ Constructor args:
185
+ label_list: an array of MSBuild labels that correspond to the MSVS index.
186
+ In the rare cases where MSVS has skipped an index value, None is
187
+ used in the array to indicate the unused spot.
188
+ new: an array of labels that are new to MSBuild.
189
+ """
190
+
191
+ def __init__(self, label_list, new=None):
192
+ _Type.__init__(self)
193
+ self._label_list = label_list
194
+ self._msbuild_values = {value for value in label_list if value is not None}
195
+ if new is not None:
196
+ self._msbuild_values.update(new)
197
+
198
+ def ValidateMSVS(self, value):
199
+ # Try to convert. It will raise an exception if not valid.
200
+ self.ConvertToMSBuild(value)
201
+
202
+ def ValidateMSBuild(self, value):
203
+ if value not in self._msbuild_values:
204
+ raise ValueError("unrecognized enumerated value %s" % value)
205
+
206
+ def ConvertToMSBuild(self, value):
207
+ index = int(value)
208
+ if index < 0 or index >= len(self._label_list):
209
+ raise ValueError(
210
+ "index value (%d) not in expected range [0, %d)"
211
+ % (index, len(self._label_list))
212
+ )
213
+ label = self._label_list[index]
214
+ if label is None:
215
+ raise ValueError("converted value for %s not specified." % value)
216
+ return label
217
+
218
+
219
+ # Instantiate the various generic types.
220
+ _boolean = _Boolean()
221
+ _integer = _Integer()
222
+ # For now, we don't do any special validation on these types:
223
+ _string = _String()
224
+ _file_name = _String()
225
+ _folder_name = _String()
226
+ _file_list = _StringList()
227
+ _folder_list = _StringList()
228
+ _string_list = _StringList()
229
+ # Some boolean settings went from numerical values to boolean. The
230
+ # mapping is 0: default, 1: false, 2: true.
231
+ _newly_boolean = _Enumeration(["", "false", "true"])
232
+
233
+
234
+ def _Same(tool, name, setting_type):
235
+ """Defines a setting that has the same name in MSVS and MSBuild.
236
+
237
+ Args:
238
+ tool: a dictionary that gives the names of the tool for MSVS and MSBuild.
239
+ name: the name of the setting.
240
+ setting_type: the type of this setting.
241
+ """
242
+ _Renamed(tool, name, name, setting_type)
243
+
244
+
245
+ def _Renamed(tool, msvs_name, msbuild_name, setting_type):
246
+ """Defines a setting for which the name has changed.
247
+
248
+ Args:
249
+ tool: a dictionary that gives the names of the tool for MSVS and MSBuild.
250
+ msvs_name: the name of the MSVS setting.
251
+ msbuild_name: the name of the MSBuild setting.
252
+ setting_type: the type of this setting.
253
+ """
254
+
255
+ def _Translate(value, msbuild_settings):
256
+ msbuild_tool_settings = _GetMSBuildToolSettings(msbuild_settings, tool)
257
+ msbuild_tool_settings[msbuild_name] = setting_type.ConvertToMSBuild(value)
258
+
259
+ _msvs_validators[tool.msvs_name][msvs_name] = setting_type.ValidateMSVS
260
+ _msbuild_validators[tool.msbuild_name][msbuild_name] = setting_type.ValidateMSBuild
261
+ _msvs_to_msbuild_converters[tool.msvs_name][msvs_name] = _Translate
262
+
263
+
264
+ def _Moved(tool, settings_name, msbuild_tool_name, setting_type):
265
+ _MovedAndRenamed(
266
+ tool, settings_name, msbuild_tool_name, settings_name, setting_type
267
+ )
268
+
269
+
270
+ def _MovedAndRenamed(
271
+ tool, msvs_settings_name, msbuild_tool_name, msbuild_settings_name, setting_type
272
+ ):
273
+ """Defines a setting that may have moved to a new section.
274
+
275
+ Args:
276
+ tool: a dictionary that gives the names of the tool for MSVS and MSBuild.
277
+ msvs_settings_name: the MSVS name of the setting.
278
+ msbuild_tool_name: the name of the MSBuild tool to place the setting under.
279
+ msbuild_settings_name: the MSBuild name of the setting.
280
+ setting_type: the type of this setting.
281
+ """
282
+
283
+ def _Translate(value, msbuild_settings):
284
+ tool_settings = msbuild_settings.setdefault(msbuild_tool_name, {})
285
+ tool_settings[msbuild_settings_name] = setting_type.ConvertToMSBuild(value)
286
+
287
+ _msvs_validators[tool.msvs_name][msvs_settings_name] = setting_type.ValidateMSVS
288
+ validator = setting_type.ValidateMSBuild
289
+ _msbuild_validators[msbuild_tool_name][msbuild_settings_name] = validator
290
+ _msvs_to_msbuild_converters[tool.msvs_name][msvs_settings_name] = _Translate
291
+
292
+
293
+ def _MSVSOnly(tool, name, setting_type):
294
+ """Defines a setting that is only found in MSVS.
295
+
296
+ Args:
297
+ tool: a dictionary that gives the names of the tool for MSVS and MSBuild.
298
+ name: the name of the setting.
299
+ setting_type: the type of this setting.
300
+ """
301
+
302
+ def _Translate(unused_value, unused_msbuild_settings):
303
+ # Since this is for MSVS only settings, no translation will happen.
304
+ pass
305
+
306
+ _msvs_validators[tool.msvs_name][name] = setting_type.ValidateMSVS
307
+ _msvs_to_msbuild_converters[tool.msvs_name][name] = _Translate
308
+
309
+
310
+ def _MSBuildOnly(tool, name, setting_type):
311
+ """Defines a setting that is only found in MSBuild.
312
+
313
+ Args:
314
+ tool: a dictionary that gives the names of the tool for MSVS and MSBuild.
315
+ name: the name of the setting.
316
+ setting_type: the type of this setting.
317
+ """
318
+
319
+ def _Translate(value, msbuild_settings):
320
+ # Let msbuild-only properties get translated as-is from msvs_settings.
321
+ tool_settings = msbuild_settings.setdefault(tool.msbuild_name, {})
322
+ tool_settings[name] = value
323
+
324
+ _msbuild_validators[tool.msbuild_name][name] = setting_type.ValidateMSBuild
325
+ _msvs_to_msbuild_converters[tool.msvs_name][name] = _Translate
326
+
327
+
328
+ def _ConvertedToAdditionalOption(tool, msvs_name, flag):
329
+ """Defines a setting that's handled via a command line option in MSBuild.
330
+
331
+ Args:
332
+ tool: a dictionary that gives the names of the tool for MSVS and MSBuild.
333
+ msvs_name: the name of the MSVS setting that if 'true' becomes a flag
334
+ flag: the flag to insert at the end of the AdditionalOptions
335
+ """
336
+
337
+ def _Translate(value, msbuild_settings):
338
+ if value == "true":
339
+ tool_settings = _GetMSBuildToolSettings(msbuild_settings, tool)
340
+ if "AdditionalOptions" in tool_settings:
341
+ new_flags = "{} {}".format(tool_settings["AdditionalOptions"], flag)
342
+ else:
343
+ new_flags = flag
344
+ tool_settings["AdditionalOptions"] = new_flags
345
+
346
+ _msvs_validators[tool.msvs_name][msvs_name] = _boolean.ValidateMSVS
347
+ _msvs_to_msbuild_converters[tool.msvs_name][msvs_name] = _Translate
348
+
349
+
350
+ def _CustomGeneratePreprocessedFile(tool, msvs_name):
351
+ def _Translate(value, msbuild_settings):
352
+ tool_settings = _GetMSBuildToolSettings(msbuild_settings, tool)
353
+ if value == "0":
354
+ tool_settings["PreprocessToFile"] = "false"
355
+ tool_settings["PreprocessSuppressLineNumbers"] = "false"
356
+ elif value == "1": # /P
357
+ tool_settings["PreprocessToFile"] = "true"
358
+ tool_settings["PreprocessSuppressLineNumbers"] = "false"
359
+ elif value == "2": # /EP /P
360
+ tool_settings["PreprocessToFile"] = "true"
361
+ tool_settings["PreprocessSuppressLineNumbers"] = "true"
362
+ else:
363
+ raise ValueError("value must be one of [0, 1, 2]; got %s" % value)
364
+
365
+ # Create a bogus validator that looks for '0', '1', or '2'
366
+ msvs_validator = _Enumeration(["a", "b", "c"]).ValidateMSVS
367
+ _msvs_validators[tool.msvs_name][msvs_name] = msvs_validator
368
+ msbuild_validator = _boolean.ValidateMSBuild
369
+ msbuild_tool_validators = _msbuild_validators[tool.msbuild_name]
370
+ msbuild_tool_validators["PreprocessToFile"] = msbuild_validator
371
+ msbuild_tool_validators["PreprocessSuppressLineNumbers"] = msbuild_validator
372
+ _msvs_to_msbuild_converters[tool.msvs_name][msvs_name] = _Translate
373
+
374
+
375
+ fix_vc_macro_slashes_regex_list = ("IntDir", "OutDir")
376
+ fix_vc_macro_slashes_regex = re.compile(
377
+ r"(\$\((?:%s)\))(?:[\\/]+)" % "|".join(fix_vc_macro_slashes_regex_list)
378
+ )
379
+
380
+ # Regular expression to detect keys that were generated by exclusion lists
381
+ _EXCLUDED_SUFFIX_RE = re.compile("^(.*)_excluded$")
382
+
383
+
384
+ def _ValidateExclusionSetting(setting, settings, error_msg, stderr=sys.stderr):
385
+ """Verify that 'setting' is valid if it is generated from an exclusion list.
386
+
387
+ If the setting appears to be generated from an exclusion list, the root name
388
+ is checked.
389
+
390
+ Args:
391
+ setting: A string that is the setting name to validate
392
+ settings: A dictionary where the keys are valid settings
393
+ error_msg: The message to emit in the event of error
394
+ stderr: The stream receiving the error messages.
395
+ """
396
+ # This may be unrecognized because it's an exclusion list. If the
397
+ # setting name has the _excluded suffix, then check the root name.
398
+ unrecognized = True
399
+ m = re.match(_EXCLUDED_SUFFIX_RE, setting)
400
+ if m:
401
+ root_setting = m.group(1)
402
+ unrecognized = root_setting not in settings
403
+
404
+ if unrecognized:
405
+ # We don't know this setting. Give a warning.
406
+ print(error_msg, file=stderr)
407
+
408
+
409
+ def FixVCMacroSlashes(s):
410
+ """Replace macros which have excessive following slashes.
411
+
412
+ These macros are known to have a built-in trailing slash. Furthermore, many
413
+ scripts hiccup on processing paths with extra slashes in the middle.
414
+
415
+ This list is probably not exhaustive. Add as needed.
416
+ """
417
+ if "$" in s:
418
+ s = fix_vc_macro_slashes_regex.sub(r"\1", s)
419
+ return s
420
+
421
+
422
+ def ConvertVCMacrosToMSBuild(s):
423
+ """Convert the MSVS macros found in the string to the MSBuild equivalent.
424
+
425
+ This list is probably not exhaustive. Add as needed.
426
+ """
427
+ if "$" in s:
428
+ replace_map = {
429
+ "$(ConfigurationName)": "$(Configuration)",
430
+ "$(InputDir)": "%(RelativeDir)",
431
+ "$(InputExt)": "%(Extension)",
432
+ "$(InputFileName)": "%(Filename)%(Extension)",
433
+ "$(InputName)": "%(Filename)",
434
+ "$(InputPath)": "%(Identity)",
435
+ "$(ParentName)": "$(ProjectFileName)",
436
+ "$(PlatformName)": "$(Platform)",
437
+ "$(SafeInputName)": "%(Filename)",
438
+ }
439
+ for old, new in replace_map.items():
440
+ s = s.replace(old, new)
441
+ s = FixVCMacroSlashes(s)
442
+ return s
443
+
444
+
445
+ def ConvertToMSBuildSettings(msvs_settings, stderr=sys.stderr):
446
+ """Converts MSVS settings (VS2008 and earlier) to MSBuild settings (VS2010+).
447
+
448
+ Args:
449
+ msvs_settings: A dictionary. The key is the tool name. The values are
450
+ themselves dictionaries of settings and their values.
451
+ stderr: The stream receiving the error messages.
452
+
453
+ Returns:
454
+ A dictionary of MSBuild settings. The key is either the MSBuild tool name
455
+ or the empty string (for the global settings). The values are themselves
456
+ dictionaries of settings and their values.
457
+ """
458
+ msbuild_settings = {}
459
+ for msvs_tool_name, msvs_tool_settings in msvs_settings.items():
460
+ if msvs_tool_name in _msvs_to_msbuild_converters:
461
+ msvs_tool = _msvs_to_msbuild_converters[msvs_tool_name]
462
+ for msvs_setting, msvs_value in msvs_tool_settings.items():
463
+ if msvs_setting in msvs_tool:
464
+ # Invoke the translation function.
465
+ try:
466
+ msvs_tool[msvs_setting](msvs_value, msbuild_settings)
467
+ except ValueError as e:
468
+ print(
469
+ "Warning: while converting %s/%s to MSBuild, "
470
+ "%s" % (msvs_tool_name, msvs_setting, e),
471
+ file=stderr,
472
+ )
473
+ else:
474
+ _ValidateExclusionSetting(
475
+ msvs_setting,
476
+ msvs_tool,
477
+ (
478
+ "Warning: unrecognized setting %s/%s "
479
+ "while converting to MSBuild."
480
+ % (msvs_tool_name, msvs_setting)
481
+ ),
482
+ stderr,
483
+ )
484
+ else:
485
+ print(
486
+ "Warning: unrecognized tool %s while converting to "
487
+ "MSBuild." % msvs_tool_name,
488
+ file=stderr,
489
+ )
490
+ return msbuild_settings
491
+
492
+
493
+ def ValidateMSVSSettings(settings, stderr=sys.stderr):
494
+ """Validates that the names of the settings are valid for MSVS.
495
+
496
+ Args:
497
+ settings: A dictionary. The key is the tool name. The values are
498
+ themselves dictionaries of settings and their values.
499
+ stderr: The stream receiving the error messages.
500
+ """
501
+ _ValidateSettings(_msvs_validators, settings, stderr)
502
+
503
+
504
+ def ValidateMSBuildSettings(settings, stderr=sys.stderr):
505
+ """Validates that the names of the settings are valid for MSBuild.
506
+
507
+ Args:
508
+ settings: A dictionary. The key is the tool name. The values are
509
+ themselves dictionaries of settings and their values.
510
+ stderr: The stream receiving the error messages.
511
+ """
512
+ _ValidateSettings(_msbuild_validators, settings, stderr)
513
+
514
+
515
+ def _ValidateSettings(validators, settings, stderr):
516
+ """Validates that the settings are valid for MSBuild or MSVS.
517
+
518
+ We currently only validate the names of the settings, not their values.
519
+
520
+ Args:
521
+ validators: A dictionary of tools and their validators.
522
+ settings: A dictionary. The key is the tool name. The values are
523
+ themselves dictionaries of settings and their values.
524
+ stderr: The stream receiving the error messages.
525
+ """
526
+ for tool_name in settings:
527
+ if tool_name in validators:
528
+ tool_validators = validators[tool_name]
529
+ for setting, value in settings[tool_name].items():
530
+ if setting in tool_validators:
531
+ try:
532
+ tool_validators[setting](value)
533
+ except ValueError as e:
534
+ print(
535
+ f"Warning: for {tool_name}/{setting}, {e}",
536
+ file=stderr,
537
+ )
538
+ else:
539
+ _ValidateExclusionSetting(
540
+ setting,
541
+ tool_validators,
542
+ (f"Warning: unrecognized setting {tool_name}/{setting}"),
543
+ stderr,
544
+ )
545
+
546
+ else:
547
+ print("Warning: unrecognized tool %s" % (tool_name), file=stderr)
548
+
549
+
550
+ # MSVS and MBuild names of the tools.
551
+ _compile = _Tool("VCCLCompilerTool", "ClCompile")
552
+ _link = _Tool("VCLinkerTool", "Link")
553
+ _midl = _Tool("VCMIDLTool", "Midl")
554
+ _rc = _Tool("VCResourceCompilerTool", "ResourceCompile")
555
+ _lib = _Tool("VCLibrarianTool", "Lib")
556
+ _manifest = _Tool("VCManifestTool", "Manifest")
557
+ _masm = _Tool("MASM", "MASM")
558
+ _armasm = _Tool("ARMASM", "ARMASM")
559
+
560
+
561
+ _AddTool(_compile)
562
+ _AddTool(_link)
563
+ _AddTool(_midl)
564
+ _AddTool(_rc)
565
+ _AddTool(_lib)
566
+ _AddTool(_manifest)
567
+ _AddTool(_masm)
568
+ _AddTool(_armasm)
569
+ # Add sections only found in the MSBuild settings.
570
+ _msbuild_validators[""] = {}
571
+ _msbuild_validators["ProjectReference"] = {}
572
+ _msbuild_validators["ManifestResourceCompile"] = {}
573
+
574
+ # Descriptions of the compiler options, i.e. VCCLCompilerTool in MSVS and
575
+ # ClCompile in MSBuild.
576
+ # See "c:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\1033\cl.xml" for
577
+ # the schema of the MSBuild ClCompile settings.
578
+
579
+ # Options that have the same name in MSVS and MSBuild
580
+ _Same(_compile, "AdditionalIncludeDirectories", _folder_list) # /I
581
+ _Same(_compile, "AdditionalOptions", _string_list)
582
+ _Same(_compile, "AdditionalUsingDirectories", _folder_list) # /AI
583
+ _Same(_compile, "AssemblerListingLocation", _file_name) # /Fa
584
+ _Same(_compile, "BrowseInformationFile", _file_name)
585
+ _Same(_compile, "BufferSecurityCheck", _boolean) # /GS
586
+ _Same(_compile, "DisableLanguageExtensions", _boolean) # /Za
587
+ _Same(_compile, "DisableSpecificWarnings", _string_list) # /wd
588
+ _Same(_compile, "EnableFiberSafeOptimizations", _boolean) # /GT
589
+ _Same(_compile, "EnablePREfast", _boolean) # /analyze Visible='false'
590
+ _Same(_compile, "ExpandAttributedSource", _boolean) # /Fx
591
+ _Same(_compile, "FloatingPointExceptions", _boolean) # /fp:except
592
+ _Same(_compile, "ForceConformanceInForLoopScope", _boolean) # /Zc:forScope
593
+ _Same(_compile, "ForcedIncludeFiles", _file_list) # /FI
594
+ _Same(_compile, "ForcedUsingFiles", _file_list) # /FU
595
+ _Same(_compile, "GenerateXMLDocumentationFiles", _boolean) # /doc
596
+ _Same(_compile, "IgnoreStandardIncludePath", _boolean) # /X
597
+ _Same(_compile, "MinimalRebuild", _boolean) # /Gm
598
+ _Same(_compile, "OmitDefaultLibName", _boolean) # /Zl
599
+ _Same(_compile, "OmitFramePointers", _boolean) # /Oy
600
+ _Same(_compile, "PreprocessorDefinitions", _string_list) # /D
601
+ _Same(_compile, "ProgramDataBaseFileName", _file_name) # /Fd
602
+ _Same(_compile, "RuntimeTypeInfo", _boolean) # /GR
603
+ _Same(_compile, "ShowIncludes", _boolean) # /showIncludes
604
+ _Same(_compile, "SmallerTypeCheck", _boolean) # /RTCc
605
+ _Same(_compile, "StringPooling", _boolean) # /GF
606
+ _Same(_compile, "SuppressStartupBanner", _boolean) # /nologo
607
+ _Same(_compile, "TreatWChar_tAsBuiltInType", _boolean) # /Zc:wchar_t
608
+ _Same(_compile, "UndefineAllPreprocessorDefinitions", _boolean) # /u
609
+ _Same(_compile, "UndefinePreprocessorDefinitions", _string_list) # /U
610
+ _Same(_compile, "UseFullPaths", _boolean) # /FC
611
+ _Same(_compile, "WholeProgramOptimization", _boolean) # /GL
612
+ _Same(_compile, "XMLDocumentationFileName", _file_name)
613
+ _Same(_compile, "CompileAsWinRT", _boolean) # /ZW
614
+
615
+ _Same(
616
+ _compile,
617
+ "AssemblerOutput",
618
+ _Enumeration(
619
+ [
620
+ "NoListing",
621
+ "AssemblyCode", # /FA
622
+ "All", # /FAcs
623
+ "AssemblyAndMachineCode", # /FAc
624
+ "AssemblyAndSourceCode",
625
+ ]
626
+ ),
627
+ ) # /FAs
628
+ _Same(
629
+ _compile,
630
+ "BasicRuntimeChecks",
631
+ _Enumeration(
632
+ [
633
+ "Default",
634
+ "StackFrameRuntimeCheck", # /RTCs
635
+ "UninitializedLocalUsageCheck", # /RTCu
636
+ "EnableFastChecks",
637
+ ]
638
+ ),
639
+ ) # /RTC1
640
+ _Same(
641
+ _compile, "BrowseInformation", _Enumeration(["false", "true", "true"]) # /FR
642
+ ) # /Fr
643
+ _Same(
644
+ _compile,
645
+ "CallingConvention",
646
+ _Enumeration(["Cdecl", "FastCall", "StdCall", "VectorCall"]), # /Gd # /Gr # /Gz
647
+ ) # /Gv
648
+ _Same(
649
+ _compile,
650
+ "CompileAs",
651
+ _Enumeration(["Default", "CompileAsC", "CompileAsCpp"]), # /TC
652
+ ) # /TP
653
+ _Same(
654
+ _compile,
655
+ "DebugInformationFormat",
656
+ _Enumeration(
657
+ [
658
+ "", # Disabled
659
+ "OldStyle", # /Z7
660
+ None,
661
+ "ProgramDatabase", # /Zi
662
+ "EditAndContinue",
663
+ ]
664
+ ),
665
+ ) # /ZI
666
+ _Same(
667
+ _compile,
668
+ "EnableEnhancedInstructionSet",
669
+ _Enumeration(
670
+ [
671
+ "NotSet",
672
+ "StreamingSIMDExtensions", # /arch:SSE
673
+ "StreamingSIMDExtensions2", # /arch:SSE2
674
+ "AdvancedVectorExtensions", # /arch:AVX (vs2012+)
675
+ "NoExtensions", # /arch:IA32 (vs2012+)
676
+ # This one only exists in the new msbuild format.
677
+ "AdvancedVectorExtensions2", # /arch:AVX2 (vs2013r2+)
678
+ ]
679
+ ),
680
+ )
681
+ _Same(
682
+ _compile,
683
+ "ErrorReporting",
684
+ _Enumeration(
685
+ [
686
+ "None", # /errorReport:none
687
+ "Prompt", # /errorReport:prompt
688
+ "Queue",
689
+ ], # /errorReport:queue
690
+ new=["Send"],
691
+ ),
692
+ ) # /errorReport:send"
693
+ _Same(
694
+ _compile,
695
+ "ExceptionHandling",
696
+ _Enumeration(["false", "Sync", "Async"], new=["SyncCThrow"]), # /EHsc # /EHa
697
+ ) # /EHs
698
+ _Same(
699
+ _compile, "FavorSizeOrSpeed", _Enumeration(["Neither", "Speed", "Size"]) # /Ot
700
+ ) # /Os
701
+ _Same(
702
+ _compile,
703
+ "FloatingPointModel",
704
+ _Enumeration(["Precise", "Strict", "Fast"]), # /fp:precise # /fp:strict
705
+ ) # /fp:fast
706
+ _Same(
707
+ _compile,
708
+ "InlineFunctionExpansion",
709
+ _Enumeration(
710
+ ["Default", "OnlyExplicitInline", "AnySuitable"], # /Ob1 # /Ob2
711
+ new=["Disabled"],
712
+ ),
713
+ ) # /Ob0
714
+ _Same(
715
+ _compile,
716
+ "Optimization",
717
+ _Enumeration(["Disabled", "MinSpace", "MaxSpeed", "Full"]), # /Od # /O1 # /O2
718
+ ) # /Ox
719
+ _Same(
720
+ _compile,
721
+ "RuntimeLibrary",
722
+ _Enumeration(
723
+ [
724
+ "MultiThreaded", # /MT
725
+ "MultiThreadedDebug", # /MTd
726
+ "MultiThreadedDLL", # /MD
727
+ "MultiThreadedDebugDLL",
728
+ ]
729
+ ),
730
+ ) # /MDd
731
+ _Same(
732
+ _compile,
733
+ "StructMemberAlignment",
734
+ _Enumeration(
735
+ [
736
+ "Default",
737
+ "1Byte", # /Zp1
738
+ "2Bytes", # /Zp2
739
+ "4Bytes", # /Zp4
740
+ "8Bytes", # /Zp8
741
+ "16Bytes",
742
+ ]
743
+ ),
744
+ ) # /Zp16
745
+ _Same(
746
+ _compile,
747
+ "WarningLevel",
748
+ _Enumeration(
749
+ [
750
+ "TurnOffAllWarnings", # /W0
751
+ "Level1", # /W1
752
+ "Level2", # /W2
753
+ "Level3", # /W3
754
+ "Level4",
755
+ ], # /W4
756
+ new=["EnableAllWarnings"],
757
+ ),
758
+ ) # /Wall
759
+
760
+ # Options found in MSVS that have been renamed in MSBuild.
761
+ _Renamed(
762
+ _compile, "EnableFunctionLevelLinking", "FunctionLevelLinking", _boolean
763
+ ) # /Gy
764
+ _Renamed(_compile, "EnableIntrinsicFunctions", "IntrinsicFunctions", _boolean) # /Oi
765
+ _Renamed(_compile, "KeepComments", "PreprocessKeepComments", _boolean) # /C
766
+ _Renamed(_compile, "ObjectFile", "ObjectFileName", _file_name) # /Fo
767
+ _Renamed(_compile, "OpenMP", "OpenMPSupport", _boolean) # /openmp
768
+ _Renamed(
769
+ _compile, "PrecompiledHeaderThrough", "PrecompiledHeaderFile", _file_name
770
+ ) # Used with /Yc and /Yu
771
+ _Renamed(
772
+ _compile, "PrecompiledHeaderFile", "PrecompiledHeaderOutputFile", _file_name
773
+ ) # /Fp
774
+ _Renamed(
775
+ _compile,
776
+ "UsePrecompiledHeader",
777
+ "PrecompiledHeader",
778
+ _Enumeration(
779
+ ["NotUsing", "Create", "Use"] # VS recognized '' for this value too. # /Yc
780
+ ),
781
+ ) # /Yu
782
+ _Renamed(_compile, "WarnAsError", "TreatWarningAsError", _boolean) # /WX
783
+
784
+ _ConvertedToAdditionalOption(_compile, "DefaultCharIsUnsigned", "/J")
785
+
786
+ # MSVS options not found in MSBuild.
787
+ _MSVSOnly(_compile, "Detect64BitPortabilityProblems", _boolean)
788
+ _MSVSOnly(_compile, "UseUnicodeResponseFiles", _boolean)
789
+
790
+ # MSBuild options not found in MSVS.
791
+ _MSBuildOnly(_compile, "BuildingInIDE", _boolean)
792
+ _MSBuildOnly(
793
+ _compile, "CompileAsManaged", _Enumeration([], new=["false", "true"])
794
+ ) # /clr
795
+ _MSBuildOnly(_compile, "CreateHotpatchableImage", _boolean) # /hotpatch
796
+ _MSBuildOnly(_compile, "MultiProcessorCompilation", _boolean) # /MP
797
+ _MSBuildOnly(_compile, "PreprocessOutputPath", _string) # /Fi
798
+ _MSBuildOnly(_compile, "ProcessorNumber", _integer) # the number of processors
799
+ _MSBuildOnly(_compile, "TrackerLogDirectory", _folder_name)
800
+ _MSBuildOnly(_compile, "TreatSpecificWarningsAsErrors", _string_list) # /we
801
+ _MSBuildOnly(_compile, "UseUnicodeForAssemblerListing", _boolean) # /FAu
802
+
803
+ # Defines a setting that needs very customized processing
804
+ _CustomGeneratePreprocessedFile(_compile, "GeneratePreprocessedFile")
805
+
806
+
807
+ # Directives for converting MSVS VCLinkerTool to MSBuild Link.
808
+ # See "c:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\1033\link.xml" for
809
+ # the schema of the MSBuild Link settings.
810
+
811
+ # Options that have the same name in MSVS and MSBuild
812
+ _Same(_link, "AdditionalDependencies", _file_list)
813
+ _Same(_link, "AdditionalLibraryDirectories", _folder_list) # /LIBPATH
814
+ # /MANIFESTDEPENDENCY:
815
+ _Same(_link, "AdditionalManifestDependencies", _file_list)
816
+ _Same(_link, "AdditionalOptions", _string_list)
817
+ _Same(_link, "AddModuleNamesToAssembly", _file_list) # /ASSEMBLYMODULE
818
+ _Same(_link, "AllowIsolation", _boolean) # /ALLOWISOLATION
819
+ _Same(_link, "AssemblyLinkResource", _file_list) # /ASSEMBLYLINKRESOURCE
820
+ _Same(_link, "BaseAddress", _string) # /BASE
821
+ _Same(_link, "CLRUnmanagedCodeCheck", _boolean) # /CLRUNMANAGEDCODECHECK
822
+ _Same(_link, "DelayLoadDLLs", _file_list) # /DELAYLOAD
823
+ _Same(_link, "DelaySign", _boolean) # /DELAYSIGN
824
+ _Same(_link, "EmbedManagedResourceFile", _file_list) # /ASSEMBLYRESOURCE
825
+ _Same(_link, "EnableUAC", _boolean) # /MANIFESTUAC
826
+ _Same(_link, "EntryPointSymbol", _string) # /ENTRY
827
+ _Same(_link, "ForceSymbolReferences", _file_list) # /INCLUDE
828
+ _Same(_link, "FunctionOrder", _file_name) # /ORDER
829
+ _Same(_link, "GenerateDebugInformation", _boolean) # /DEBUG
830
+ _Same(_link, "GenerateMapFile", _boolean) # /MAP
831
+ _Same(_link, "HeapCommitSize", _string)
832
+ _Same(_link, "HeapReserveSize", _string) # /HEAP
833
+ _Same(_link, "IgnoreAllDefaultLibraries", _boolean) # /NODEFAULTLIB
834
+ _Same(_link, "IgnoreEmbeddedIDL", _boolean) # /IGNOREIDL
835
+ _Same(_link, "ImportLibrary", _file_name) # /IMPLIB
836
+ _Same(_link, "KeyContainer", _file_name) # /KEYCONTAINER
837
+ _Same(_link, "KeyFile", _file_name) # /KEYFILE
838
+ _Same(_link, "ManifestFile", _file_name) # /ManifestFile
839
+ _Same(_link, "MapExports", _boolean) # /MAPINFO:EXPORTS
840
+ _Same(_link, "MapFileName", _file_name)
841
+ _Same(_link, "MergedIDLBaseFileName", _file_name) # /IDLOUT
842
+ _Same(_link, "MergeSections", _string) # /MERGE
843
+ _Same(_link, "MidlCommandFile", _file_name) # /MIDL
844
+ _Same(_link, "ModuleDefinitionFile", _file_name) # /DEF
845
+ _Same(_link, "OutputFile", _file_name) # /OUT
846
+ _Same(_link, "PerUserRedirection", _boolean)
847
+ _Same(_link, "Profile", _boolean) # /PROFILE
848
+ _Same(_link, "ProfileGuidedDatabase", _file_name) # /PGD
849
+ _Same(_link, "ProgramDatabaseFile", _file_name) # /PDB
850
+ _Same(_link, "RegisterOutput", _boolean)
851
+ _Same(_link, "SetChecksum", _boolean) # /RELEASE
852
+ _Same(_link, "StackCommitSize", _string)
853
+ _Same(_link, "StackReserveSize", _string) # /STACK
854
+ _Same(_link, "StripPrivateSymbols", _file_name) # /PDBSTRIPPED
855
+ _Same(_link, "SupportUnloadOfDelayLoadedDLL", _boolean) # /DELAY:UNLOAD
856
+ _Same(_link, "SuppressStartupBanner", _boolean) # /NOLOGO
857
+ _Same(_link, "SwapRunFromCD", _boolean) # /SWAPRUN:CD
858
+ _Same(_link, "TurnOffAssemblyGeneration", _boolean) # /NOASSEMBLY
859
+ _Same(_link, "TypeLibraryFile", _file_name) # /TLBOUT
860
+ _Same(_link, "TypeLibraryResourceID", _integer) # /TLBID
861
+ _Same(_link, "UACUIAccess", _boolean) # /uiAccess='true'
862
+ _Same(_link, "Version", _string) # /VERSION
863
+
864
+ _Same(_link, "EnableCOMDATFolding", _newly_boolean) # /OPT:ICF
865
+ _Same(_link, "FixedBaseAddress", _newly_boolean) # /FIXED
866
+ _Same(_link, "LargeAddressAware", _newly_boolean) # /LARGEADDRESSAWARE
867
+ _Same(_link, "OptimizeReferences", _newly_boolean) # /OPT:REF
868
+ _Same(_link, "RandomizedBaseAddress", _newly_boolean) # /DYNAMICBASE
869
+ _Same(_link, "TerminalServerAware", _newly_boolean) # /TSAWARE
870
+
871
+ _subsystem_enumeration = _Enumeration(
872
+ [
873
+ "NotSet",
874
+ "Console", # /SUBSYSTEM:CONSOLE
875
+ "Windows", # /SUBSYSTEM:WINDOWS
876
+ "Native", # /SUBSYSTEM:NATIVE
877
+ "EFI Application", # /SUBSYSTEM:EFI_APPLICATION
878
+ "EFI Boot Service Driver", # /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER
879
+ "EFI ROM", # /SUBSYSTEM:EFI_ROM
880
+ "EFI Runtime", # /SUBSYSTEM:EFI_RUNTIME_DRIVER
881
+ "WindowsCE",
882
+ ], # /SUBSYSTEM:WINDOWSCE
883
+ new=["POSIX"],
884
+ ) # /SUBSYSTEM:POSIX
885
+
886
+ _target_machine_enumeration = _Enumeration(
887
+ [
888
+ "NotSet",
889
+ "MachineX86", # /MACHINE:X86
890
+ None,
891
+ "MachineARM", # /MACHINE:ARM
892
+ "MachineEBC", # /MACHINE:EBC
893
+ "MachineIA64", # /MACHINE:IA64
894
+ None,
895
+ "MachineMIPS", # /MACHINE:MIPS
896
+ "MachineMIPS16", # /MACHINE:MIPS16
897
+ "MachineMIPSFPU", # /MACHINE:MIPSFPU
898
+ "MachineMIPSFPU16", # /MACHINE:MIPSFPU16
899
+ None,
900
+ None,
901
+ None,
902
+ "MachineSH4", # /MACHINE:SH4
903
+ None,
904
+ "MachineTHUMB", # /MACHINE:THUMB
905
+ "MachineX64",
906
+ ]
907
+ ) # /MACHINE:X64
908
+
909
+ _Same(
910
+ _link, "AssemblyDebug", _Enumeration(["", "true", "false"]) # /ASSEMBLYDEBUG
911
+ ) # /ASSEMBLYDEBUG:DISABLE
912
+ _Same(
913
+ _link,
914
+ "CLRImageType",
915
+ _Enumeration(
916
+ [
917
+ "Default",
918
+ "ForceIJWImage", # /CLRIMAGETYPE:IJW
919
+ "ForcePureILImage", # /Switch="CLRIMAGETYPE:PURE
920
+ "ForceSafeILImage",
921
+ ]
922
+ ),
923
+ ) # /Switch="CLRIMAGETYPE:SAFE
924
+ _Same(
925
+ _link,
926
+ "CLRThreadAttribute",
927
+ _Enumeration(
928
+ [
929
+ "DefaultThreadingAttribute", # /CLRTHREADATTRIBUTE:NONE
930
+ "MTAThreadingAttribute", # /CLRTHREADATTRIBUTE:MTA
931
+ "STAThreadingAttribute",
932
+ ]
933
+ ),
934
+ ) # /CLRTHREADATTRIBUTE:STA
935
+ _Same(
936
+ _link,
937
+ "DataExecutionPrevention",
938
+ _Enumeration(["", "false", "true"]), # /NXCOMPAT:NO
939
+ ) # /NXCOMPAT
940
+ _Same(
941
+ _link,
942
+ "Driver",
943
+ _Enumeration(["NotSet", "Driver", "UpOnly", "WDM"]), # /Driver # /DRIVER:UPONLY
944
+ ) # /DRIVER:WDM
945
+ _Same(
946
+ _link,
947
+ "LinkTimeCodeGeneration",
948
+ _Enumeration(
949
+ [
950
+ "Default",
951
+ "UseLinkTimeCodeGeneration", # /LTCG
952
+ "PGInstrument", # /LTCG:PGInstrument
953
+ "PGOptimization", # /LTCG:PGOptimize
954
+ "PGUpdate",
955
+ ]
956
+ ),
957
+ ) # /LTCG:PGUpdate
958
+ _Same(
959
+ _link,
960
+ "ShowProgress",
961
+ _Enumeration(
962
+ ["NotSet", "LinkVerbose", "LinkVerboseLib"], # /VERBOSE # /VERBOSE:Lib
963
+ new=[
964
+ "LinkVerboseICF", # /VERBOSE:ICF
965
+ "LinkVerboseREF", # /VERBOSE:REF
966
+ "LinkVerboseSAFESEH", # /VERBOSE:SAFESEH
967
+ "LinkVerboseCLR",
968
+ ],
969
+ ),
970
+ ) # /VERBOSE:CLR
971
+ _Same(_link, "SubSystem", _subsystem_enumeration)
972
+ _Same(_link, "TargetMachine", _target_machine_enumeration)
973
+ _Same(
974
+ _link,
975
+ "UACExecutionLevel",
976
+ _Enumeration(
977
+ [
978
+ "AsInvoker", # /level='asInvoker'
979
+ "HighestAvailable", # /level='highestAvailable'
980
+ "RequireAdministrator",
981
+ ]
982
+ ),
983
+ ) # /level='requireAdministrator'
984
+ _Same(_link, "MinimumRequiredVersion", _string)
985
+ _Same(_link, "TreatLinkerWarningAsErrors", _boolean) # /WX
986
+
987
+
988
+ # Options found in MSVS that have been renamed in MSBuild.
989
+ _Renamed(
990
+ _link,
991
+ "ErrorReporting",
992
+ "LinkErrorReporting",
993
+ _Enumeration(
994
+ [
995
+ "NoErrorReport", # /ERRORREPORT:NONE
996
+ "PromptImmediately", # /ERRORREPORT:PROMPT
997
+ "QueueForNextLogin",
998
+ ], # /ERRORREPORT:QUEUE
999
+ new=["SendErrorReport"],
1000
+ ),
1001
+ ) # /ERRORREPORT:SEND
1002
+ _Renamed(
1003
+ _link, "IgnoreDefaultLibraryNames", "IgnoreSpecificDefaultLibraries", _file_list
1004
+ ) # /NODEFAULTLIB
1005
+ _Renamed(_link, "ResourceOnlyDLL", "NoEntryPoint", _boolean) # /NOENTRY
1006
+ _Renamed(_link, "SwapRunFromNet", "SwapRunFromNET", _boolean) # /SWAPRUN:NET
1007
+
1008
+ _Moved(_link, "GenerateManifest", "", _boolean)
1009
+ _Moved(_link, "IgnoreImportLibrary", "", _boolean)
1010
+ _Moved(_link, "LinkIncremental", "", _newly_boolean)
1011
+ _Moved(_link, "LinkLibraryDependencies", "ProjectReference", _boolean)
1012
+ _Moved(_link, "UseLibraryDependencyInputs", "ProjectReference", _boolean)
1013
+
1014
+ # MSVS options not found in MSBuild.
1015
+ _MSVSOnly(_link, "OptimizeForWindows98", _newly_boolean)
1016
+ _MSVSOnly(_link, "UseUnicodeResponseFiles", _boolean)
1017
+
1018
+ # MSBuild options not found in MSVS.
1019
+ _MSBuildOnly(_link, "BuildingInIDE", _boolean)
1020
+ _MSBuildOnly(_link, "ImageHasSafeExceptionHandlers", _boolean) # /SAFESEH
1021
+ _MSBuildOnly(_link, "LinkDLL", _boolean) # /DLL Visible='false'
1022
+ _MSBuildOnly(_link, "LinkStatus", _boolean) # /LTCG:STATUS
1023
+ _MSBuildOnly(_link, "PreventDllBinding", _boolean) # /ALLOWBIND
1024
+ _MSBuildOnly(_link, "SupportNobindOfDelayLoadedDLL", _boolean) # /DELAY:NOBIND
1025
+ _MSBuildOnly(_link, "TrackerLogDirectory", _folder_name)
1026
+ _MSBuildOnly(_link, "MSDOSStubFileName", _file_name) # /STUB Visible='false'
1027
+ _MSBuildOnly(_link, "SectionAlignment", _integer) # /ALIGN
1028
+ _MSBuildOnly(_link, "SpecifySectionAttributes", _string) # /SECTION
1029
+ _MSBuildOnly(
1030
+ _link,
1031
+ "ForceFileOutput",
1032
+ _Enumeration(
1033
+ [],
1034
+ new=[
1035
+ "Enabled", # /FORCE
1036
+ # /FORCE:MULTIPLE
1037
+ "MultiplyDefinedSymbolOnly",
1038
+ "UndefinedSymbolOnly",
1039
+ ],
1040
+ ),
1041
+ ) # /FORCE:UNRESOLVED
1042
+ _MSBuildOnly(
1043
+ _link,
1044
+ "CreateHotPatchableImage",
1045
+ _Enumeration(
1046
+ [],
1047
+ new=[
1048
+ "Enabled", # /FUNCTIONPADMIN
1049
+ "X86Image", # /FUNCTIONPADMIN:5
1050
+ "X64Image", # /FUNCTIONPADMIN:6
1051
+ "ItaniumImage",
1052
+ ],
1053
+ ),
1054
+ ) # /FUNCTIONPADMIN:16
1055
+ _MSBuildOnly(
1056
+ _link,
1057
+ "CLRSupportLastError",
1058
+ _Enumeration(
1059
+ [],
1060
+ new=[
1061
+ "Enabled", # /CLRSupportLastError
1062
+ "Disabled", # /CLRSupportLastError:NO
1063
+ # /CLRSupportLastError:SYSTEMDLL
1064
+ "SystemDlls",
1065
+ ],
1066
+ ),
1067
+ )
1068
+
1069
+
1070
+ # Directives for converting VCResourceCompilerTool to ResourceCompile.
1071
+ # See "c:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\1033\rc.xml" for
1072
+ # the schema of the MSBuild ResourceCompile settings.
1073
+
1074
+ _Same(_rc, "AdditionalOptions", _string_list)
1075
+ _Same(_rc, "AdditionalIncludeDirectories", _folder_list) # /I
1076
+ _Same(_rc, "Culture", _Integer(msbuild_base=16))
1077
+ _Same(_rc, "IgnoreStandardIncludePath", _boolean) # /X
1078
+ _Same(_rc, "PreprocessorDefinitions", _string_list) # /D
1079
+ _Same(_rc, "ResourceOutputFileName", _string) # /fo
1080
+ _Same(_rc, "ShowProgress", _boolean) # /v
1081
+ # There is no UI in VisualStudio 2008 to set the following properties.
1082
+ # However they are found in CL and other tools. Include them here for
1083
+ # completeness, as they are very likely to have the same usage pattern.
1084
+ _Same(_rc, "SuppressStartupBanner", _boolean) # /nologo
1085
+ _Same(_rc, "UndefinePreprocessorDefinitions", _string_list) # /u
1086
+
1087
+ # MSBuild options not found in MSVS.
1088
+ _MSBuildOnly(_rc, "NullTerminateStrings", _boolean) # /n
1089
+ _MSBuildOnly(_rc, "TrackerLogDirectory", _folder_name)
1090
+
1091
+
1092
+ # Directives for converting VCMIDLTool to Midl.
1093
+ # See "c:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\1033\midl.xml" for
1094
+ # the schema of the MSBuild Midl settings.
1095
+
1096
+ _Same(_midl, "AdditionalIncludeDirectories", _folder_list) # /I
1097
+ _Same(_midl, "AdditionalOptions", _string_list)
1098
+ _Same(_midl, "CPreprocessOptions", _string) # /cpp_opt
1099
+ _Same(_midl, "ErrorCheckAllocations", _boolean) # /error allocation
1100
+ _Same(_midl, "ErrorCheckBounds", _boolean) # /error bounds_check
1101
+ _Same(_midl, "ErrorCheckEnumRange", _boolean) # /error enum
1102
+ _Same(_midl, "ErrorCheckRefPointers", _boolean) # /error ref
1103
+ _Same(_midl, "ErrorCheckStubData", _boolean) # /error stub_data
1104
+ _Same(_midl, "GenerateStublessProxies", _boolean) # /Oicf
1105
+ _Same(_midl, "GenerateTypeLibrary", _boolean)
1106
+ _Same(_midl, "HeaderFileName", _file_name) # /h
1107
+ _Same(_midl, "IgnoreStandardIncludePath", _boolean) # /no_def_idir
1108
+ _Same(_midl, "InterfaceIdentifierFileName", _file_name) # /iid
1109
+ _Same(_midl, "MkTypLibCompatible", _boolean) # /mktyplib203
1110
+ _Same(_midl, "OutputDirectory", _string) # /out
1111
+ _Same(_midl, "PreprocessorDefinitions", _string_list) # /D
1112
+ _Same(_midl, "ProxyFileName", _file_name) # /proxy
1113
+ _Same(_midl, "RedirectOutputAndErrors", _file_name) # /o
1114
+ _Same(_midl, "SuppressStartupBanner", _boolean) # /nologo
1115
+ _Same(_midl, "TypeLibraryName", _file_name) # /tlb
1116
+ _Same(_midl, "UndefinePreprocessorDefinitions", _string_list) # /U
1117
+ _Same(_midl, "WarnAsError", _boolean) # /WX
1118
+
1119
+ _Same(
1120
+ _midl,
1121
+ "DefaultCharType",
1122
+ _Enumeration(["Unsigned", "Signed", "Ascii"]), # /char unsigned # /char signed
1123
+ ) # /char ascii7
1124
+ _Same(
1125
+ _midl,
1126
+ "TargetEnvironment",
1127
+ _Enumeration(
1128
+ [
1129
+ "NotSet",
1130
+ "Win32", # /env win32
1131
+ "Itanium", # /env ia64
1132
+ "X64", # /env x64
1133
+ "ARM64", # /env arm64
1134
+ ]
1135
+ ),
1136
+ )
1137
+ _Same(
1138
+ _midl,
1139
+ "EnableErrorChecks",
1140
+ _Enumeration(["EnableCustom", "None", "All"]), # /error none
1141
+ ) # /error all
1142
+ _Same(
1143
+ _midl,
1144
+ "StructMemberAlignment",
1145
+ _Enumeration(["NotSet", "1", "2", "4", "8"]), # Zp1 # Zp2 # Zp4
1146
+ ) # Zp8
1147
+ _Same(
1148
+ _midl,
1149
+ "WarningLevel",
1150
+ _Enumeration(["0", "1", "2", "3", "4"]), # /W0 # /W1 # /W2 # /W3
1151
+ ) # /W4
1152
+
1153
+ _Renamed(_midl, "DLLDataFileName", "DllDataFileName", _file_name) # /dlldata
1154
+ _Renamed(_midl, "ValidateParameters", "ValidateAllParameters", _boolean) # /robust
1155
+
1156
+ # MSBuild options not found in MSVS.
1157
+ _MSBuildOnly(_midl, "ApplicationConfigurationMode", _boolean) # /app_config
1158
+ _MSBuildOnly(_midl, "ClientStubFile", _file_name) # /cstub
1159
+ _MSBuildOnly(
1160
+ _midl, "GenerateClientFiles", _Enumeration([], new=["Stub", "None"]) # /client stub
1161
+ ) # /client none
1162
+ _MSBuildOnly(
1163
+ _midl, "GenerateServerFiles", _Enumeration([], new=["Stub", "None"]) # /client stub
1164
+ ) # /client none
1165
+ _MSBuildOnly(_midl, "LocaleID", _integer) # /lcid DECIMAL
1166
+ _MSBuildOnly(_midl, "ServerStubFile", _file_name) # /sstub
1167
+ _MSBuildOnly(_midl, "SuppressCompilerWarnings", _boolean) # /no_warn
1168
+ _MSBuildOnly(_midl, "TrackerLogDirectory", _folder_name)
1169
+ _MSBuildOnly(
1170
+ _midl, "TypeLibFormat", _Enumeration([], new=["NewFormat", "OldFormat"]) # /newtlb
1171
+ ) # /oldtlb
1172
+
1173
+
1174
+ # Directives for converting VCLibrarianTool to Lib.
1175
+ # See "c:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\1033\lib.xml" for
1176
+ # the schema of the MSBuild Lib settings.
1177
+
1178
+ _Same(_lib, "AdditionalDependencies", _file_list)
1179
+ _Same(_lib, "AdditionalLibraryDirectories", _folder_list) # /LIBPATH
1180
+ _Same(_lib, "AdditionalOptions", _string_list)
1181
+ _Same(_lib, "ExportNamedFunctions", _string_list) # /EXPORT
1182
+ _Same(_lib, "ForceSymbolReferences", _string) # /INCLUDE
1183
+ _Same(_lib, "IgnoreAllDefaultLibraries", _boolean) # /NODEFAULTLIB
1184
+ _Same(_lib, "IgnoreSpecificDefaultLibraries", _file_list) # /NODEFAULTLIB
1185
+ _Same(_lib, "ModuleDefinitionFile", _file_name) # /DEF
1186
+ _Same(_lib, "OutputFile", _file_name) # /OUT
1187
+ _Same(_lib, "SuppressStartupBanner", _boolean) # /NOLOGO
1188
+ _Same(_lib, "UseUnicodeResponseFiles", _boolean)
1189
+ _Same(_lib, "LinkTimeCodeGeneration", _boolean) # /LTCG
1190
+ _Same(_lib, "TargetMachine", _target_machine_enumeration)
1191
+
1192
+ # TODO(jeanluc) _link defines the same value that gets moved to
1193
+ # ProjectReference. We may want to validate that they are consistent.
1194
+ _Moved(_lib, "LinkLibraryDependencies", "ProjectReference", _boolean)
1195
+
1196
+ _MSBuildOnly(_lib, "DisplayLibrary", _string) # /LIST Visible='false'
1197
+ _MSBuildOnly(
1198
+ _lib,
1199
+ "ErrorReporting",
1200
+ _Enumeration(
1201
+ [],
1202
+ new=[
1203
+ "PromptImmediately", # /ERRORREPORT:PROMPT
1204
+ "QueueForNextLogin", # /ERRORREPORT:QUEUE
1205
+ "SendErrorReport", # /ERRORREPORT:SEND
1206
+ "NoErrorReport",
1207
+ ],
1208
+ ),
1209
+ ) # /ERRORREPORT:NONE
1210
+ _MSBuildOnly(_lib, "MinimumRequiredVersion", _string)
1211
+ _MSBuildOnly(_lib, "Name", _file_name) # /NAME
1212
+ _MSBuildOnly(_lib, "RemoveObjects", _file_list) # /REMOVE
1213
+ _MSBuildOnly(_lib, "SubSystem", _subsystem_enumeration)
1214
+ _MSBuildOnly(_lib, "TrackerLogDirectory", _folder_name)
1215
+ _MSBuildOnly(_lib, "TreatLibWarningAsErrors", _boolean) # /WX
1216
+ _MSBuildOnly(_lib, "Verbose", _boolean)
1217
+
1218
+
1219
+ # Directives for converting VCManifestTool to Mt.
1220
+ # See "c:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\1033\mt.xml" for
1221
+ # the schema of the MSBuild Lib settings.
1222
+
1223
+ # Options that have the same name in MSVS and MSBuild
1224
+ _Same(_manifest, "AdditionalManifestFiles", _file_list) # /manifest
1225
+ _Same(_manifest, "AdditionalOptions", _string_list)
1226
+ _Same(_manifest, "AssemblyIdentity", _string) # /identity:
1227
+ _Same(_manifest, "ComponentFileName", _file_name) # /dll
1228
+ _Same(_manifest, "GenerateCatalogFiles", _boolean) # /makecdfs
1229
+ _Same(_manifest, "InputResourceManifests", _string) # /inputresource
1230
+ _Same(_manifest, "OutputManifestFile", _file_name) # /out
1231
+ _Same(_manifest, "RegistrarScriptFile", _file_name) # /rgs
1232
+ _Same(_manifest, "ReplacementsFile", _file_name) # /replacements
1233
+ _Same(_manifest, "SuppressStartupBanner", _boolean) # /nologo
1234
+ _Same(_manifest, "TypeLibraryFile", _file_name) # /tlb:
1235
+ _Same(_manifest, "UpdateFileHashes", _boolean) # /hashupdate
1236
+ _Same(_manifest, "UpdateFileHashesSearchPath", _file_name)
1237
+ _Same(_manifest, "VerboseOutput", _boolean) # /verbose
1238
+
1239
+ # Options that have moved location.
1240
+ _MovedAndRenamed(
1241
+ _manifest,
1242
+ "ManifestResourceFile",
1243
+ "ManifestResourceCompile",
1244
+ "ResourceOutputFileName",
1245
+ _file_name,
1246
+ )
1247
+ _Moved(_manifest, "EmbedManifest", "", _boolean)
1248
+
1249
+ # MSVS options not found in MSBuild.
1250
+ _MSVSOnly(_manifest, "DependencyInformationFile", _file_name)
1251
+ _MSVSOnly(_manifest, "UseFAT32Workaround", _boolean)
1252
+ _MSVSOnly(_manifest, "UseUnicodeResponseFiles", _boolean)
1253
+
1254
+ # MSBuild options not found in MSVS.
1255
+ _MSBuildOnly(_manifest, "EnableDPIAwareness", _boolean)
1256
+ _MSBuildOnly(_manifest, "GenerateCategoryTags", _boolean) # /category
1257
+ _MSBuildOnly(
1258
+ _manifest, "ManifestFromManagedAssembly", _file_name
1259
+ ) # /managedassemblyname
1260
+ _MSBuildOnly(_manifest, "OutputResourceManifests", _string) # /outputresource
1261
+ _MSBuildOnly(_manifest, "SuppressDependencyElement", _boolean) # /nodependency
1262
+ _MSBuildOnly(_manifest, "TrackerLogDirectory", _folder_name)
1263
+
1264
+
1265
+ # Directives for MASM.
1266
+ # See "$(VCTargetsPath)\BuildCustomizations\masm.xml" for the schema of the
1267
+ # MSBuild MASM settings.
1268
+
1269
+ # Options that have the same name in MSVS and MSBuild.
1270
+ _Same(_masm, "UseSafeExceptionHandlers", _boolean) # /safeseh