diff options
author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2023-11-22 09:05:45 +0200 |
---|---|---|
committer | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2023-11-22 09:05:45 +0200 |
commit | 5201475f62517ccd0b0c4cbb4c6262a2d6908a45 (patch) | |
tree | b9eab94121961f1e9723c4b228ca05dc9adcd6b4 /methods.py | |
parent | 7022271291a3d2a9cbd6a223d22a29fd775dfc5d (diff) | |
download | redot-engine-5201475f62517ccd0b0c4cbb4c6262a2d6908a45.tar.gz |
[macOS] Check Apple specific version instead of generic clang version.
Diffstat (limited to 'methods.py')
-rw-r--r-- | methods.py | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/methods.py b/methods.py index 7a7758e24b..288c34dc91 100644 --- a/methods.py +++ b/methods.py @@ -1012,6 +1012,11 @@ def get_compiler_version(env): "metadata1": None, "metadata2": None, "date": None, + "apple_major": -1, + "apple_minor": -1, + "apple_patch1": -1, + "apple_patch2": -1, + "apple_patch3": -1, } if not env.msvc: @@ -1039,8 +1044,32 @@ def get_compiler_version(env): for key, value in match.groupdict().items(): if value is not None: ret[key] = value + + match_apple = re.search( + r"(?:(?<=clang-)|(?<=\) )|(?<=^))" + r"(?P<apple_major>\d+)" + r"(?:\.(?P<apple_minor>\d*))?" + r"(?:\.(?P<apple_patch1>\d*))?" + r"(?:\.(?P<apple_patch2>\d*))?" + r"(?:\.(?P<apple_patch3>\d*))?", + version, + ) + if match_apple is not None: + for key, value in match_apple.groupdict().items(): + if value is not None: + ret[key] = value + # Transform semantic versioning to integers - for key in ["major", "minor", "patch"]: + for key in [ + "major", + "minor", + "patch", + "apple_major", + "apple_minor", + "apple_patch1", + "apple_patch2", + "apple_patch3", + ]: ret[key] = int(ret[key] or -1) return ret |