mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
SCons: Detect msvc compiler version
• C standard now passed on msvc if the version is supported
This commit is contained in:
parent
76a135926a
commit
1043c00137
2 changed files with 60 additions and 33 deletions
21
methods.py
21
methods.py
|
@ -795,9 +795,9 @@ def get_compiler_version(env):
|
|||
"major": -1,
|
||||
"minor": -1,
|
||||
"patch": -1,
|
||||
"metadata1": None,
|
||||
"metadata2": None,
|
||||
"date": None,
|
||||
"metadata1": "",
|
||||
"metadata2": "",
|
||||
"date": "",
|
||||
"apple_major": -1,
|
||||
"apple_minor": -1,
|
||||
"apple_patch1": -1,
|
||||
|
@ -806,7 +806,20 @@ def get_compiler_version(env):
|
|||
}
|
||||
|
||||
if env.msvc and not using_clang(env):
|
||||
# TODO: Implement for MSVC
|
||||
try:
|
||||
args = [env["VSWHERE"], "-latest", "-products", "*", "-requires", "Microsoft.Component.MSBuild"]
|
||||
version = subprocess.check_output(args, encoding="utf-8").strip()
|
||||
for line in version.splitlines():
|
||||
split = line.split(":", 1)
|
||||
if split[0] == "catalog_productDisplayVersion":
|
||||
sem_ver = split[1].split(".")
|
||||
ret["major"] = int(sem_ver[0])
|
||||
ret["minor"] = int(sem_ver[1])
|
||||
ret["patch"] = int(sem_ver[2])
|
||||
if split[0] == "catalog_buildVersion":
|
||||
ret["metadata1"] = split[1]
|
||||
except (subprocess.CalledProcessError, OSError):
|
||||
print_warning("Couldn't find vswhere to determine compiler version.")
|
||||
return ret
|
||||
|
||||
# Not using -dumpversion as some GCC distros only return major, and
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue