Returns the path and tool to use for this target. Figures out the path of the file this spec will create and the name of the VC tool that will create it. Arguments: spec: The target dictionary containing the properties of the target. Returns: A triple of (file path, nam
(spec, msbuild)
| 1312 | |
| 1313 | |
| 1314 | def _GetOutputFilePathAndTool(spec, msbuild): |
| 1315 | """Returns the path and tool to use for this target. |
| 1316 | |
| 1317 | Figures out the path of the file this spec will create and the name of |
| 1318 | the VC tool that will create it. |
| 1319 | |
| 1320 | Arguments: |
| 1321 | spec: The target dictionary containing the properties of the target. |
| 1322 | Returns: |
| 1323 | A triple of (file path, name of the vc tool, name of the msbuild tool) |
| 1324 | """ |
| 1325 | # Select a name for the output file. |
| 1326 | out_file = "" |
| 1327 | vc_tool = "" |
| 1328 | msbuild_tool = "" |
| 1329 | output_file_map = { |
| 1330 | "executable": ("VCLinkerTool", "Link", "$(OutDir)", ".exe"), |
| 1331 | "shared_library": ("VCLinkerTool", "Link", "$(OutDir)", ".dll"), |
| 1332 | "loadable_module": ("VCLinkerTool", "Link", "$(OutDir)", ".dll"), |
| 1333 | "windows_driver": ("VCLinkerTool", "Link", "$(OutDir)", ".sys"), |
| 1334 | "static_library": ("VCLibrarianTool", "Lib", "$(OutDir)lib\\", ".lib"), |
| 1335 | } |
| 1336 | output_file_props = output_file_map.get(spec["type"]) |
| 1337 | if output_file_props and int(spec.get("msvs_auto_output_file", 1)): |
| 1338 | vc_tool, msbuild_tool, out_dir, suffix = output_file_props |
| 1339 | if spec.get("standalone_static_library", 0): |
| 1340 | out_dir = "$(OutDir)" |
| 1341 | out_dir = spec.get("product_dir", out_dir) |
| 1342 | product_extension = spec.get("product_extension") |
| 1343 | if product_extension: |
| 1344 | suffix = "." + product_extension |
| 1345 | elif msbuild: |
| 1346 | suffix = "$(TargetExt)" |
| 1347 | prefix = spec.get("product_prefix", "") |
| 1348 | product_name = spec.get("product_name", "$(ProjectName)") |
| 1349 | out_file = ntpath.join(out_dir, prefix + product_name + suffix) |
| 1350 | return out_file, vc_tool, msbuild_tool |
| 1351 | |
| 1352 | |
| 1353 | def _GetOutputTargetExt(spec): |
no test coverage detected