mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Improve compiler version extraction
This commit is contained in:
parent
ff648e2504
commit
c759b7b235
2 changed files with 42 additions and 7 deletions
13
methods.py
13
methods.py
|
@ -787,9 +787,18 @@ def get_compiler_version(env):
|
|||
return None
|
||||
else: # TODO: Implement for MSVC
|
||||
return None
|
||||
match = re.search("[0-9]+\.[0-9.]+", version)
|
||||
match = re.search(
|
||||
"(?:(?<=version )|(?<=\) )|(?<=^))"
|
||||
"(?P<major>\d+)"
|
||||
"(?:\.(?P<minor>\d*))?"
|
||||
"(?:\.(?P<patch>\d*))?"
|
||||
"(?:-(?P<metadata1>[0-9a-zA-Z-]*))?"
|
||||
"(?:\+(?P<metadata2>[0-9a-zA-Z-]*))?"
|
||||
"(?: (?P<date>[0-9]{8}|[0-9]{6})(?![0-9a-zA-Z]))?",
|
||||
version,
|
||||
)
|
||||
if match is not None:
|
||||
return list(map(int, match.group().split(".")))
|
||||
return match.groupdict()
|
||||
else:
|
||||
return None
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue