MCPcopy Create free account
hub / github.com/Autodesk/Aurora / GetVisualStudioCompilerAndVersion

Function GetVisualStudioCompilerAndVersion

Scripts/installExternalsFunctions.py:104–121  ·  view source on GitHub ↗

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.

()

Source from the content-addressed store, hash-verified

102 return None
103
104def 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
123def IsVisualStudioVersionOrGreater(desiredVersion):
124 if not Windows():

Callers 2

Calls 2

WindowsFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected