Returns a tuple containing the path to the Visual Studio compiler and a tuple for its version, e.g. (14, 0). If the compiler is not found or version number cannot be determined, returns None.
()
| 102 | return None |
| 103 | |
| 104 | def GetVisualStudioCompilerAndVersion(): |
| 105 | """ |
| 106 | Returns a tuple containing the path to the Visual Studio compiler |
| 107 | and a tuple for its version, e.g. (14, 0). If the compiler is not found |
| 108 | or version number cannot be determined, returns None. |
| 109 | """ |
| 110 | if not Windows(): |
| 111 | return None |
| 112 | |
| 113 | msvcCompiler = which('cl') |
| 114 | if msvcCompiler: |
| 115 | # VisualStudioVersion environment variable should be set by the |
| 116 | # Visual Studio Command Prompt. |
| 117 | match = re.search(r"(\d+)\.(\d+)", |
| 118 | os.environ.get("VisualStudioVersion", "")) |
| 119 | if match: |
| 120 | return (msvcCompiler, tuple(int(v) for v in match.groups())) |
| 121 | return None |
| 122 | |
| 123 | def IsVisualStudioVersionOrGreater(desiredVersion): |
| 124 | if not Windows(): |
no test coverage detected