mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Add support for compiling with VS clang-cl toolset
This commit is contained in:
parent
f648de1a83
commit
346cbc7f1f
13 changed files with 92 additions and 36 deletions
27
methods.py
27
methods.py
|
@ -163,7 +163,7 @@ def add_source_files(self, sources, files, allow_gen=False):
|
|||
|
||||
def disable_warnings(self):
|
||||
# 'self' is the environment
|
||||
if self.msvc:
|
||||
if self.msvc and not using_clang(self):
|
||||
# We have to remove existing warning level defines before appending /w,
|
||||
# otherwise we get: "warning D9025 : overriding '/W3' with '/w'"
|
||||
self["CCFLAGS"] = [x for x in self["CCFLAGS"] if not (x.startswith("/W") or x.startswith("/w"))]
|
||||
|
@ -817,21 +817,20 @@ def get_compiler_version(env):
|
|||
"apple_patch3": -1,
|
||||
}
|
||||
|
||||
if not env.msvc:
|
||||
# Not using -dumpversion as some GCC distros only return major, and
|
||||
# Clang used to return hardcoded 4.2.1: # https://reviews.llvm.org/D56803
|
||||
try:
|
||||
version = (
|
||||
subprocess.check_output([env.subst(env["CXX"]), "--version"], shell=(os.name == "nt"))
|
||||
.strip()
|
||||
.decode("utf-8")
|
||||
)
|
||||
except (subprocess.CalledProcessError, OSError):
|
||||
print_warning("Couldn't parse CXX environment variable to infer compiler version.")
|
||||
return ret
|
||||
else:
|
||||
if env.msvc and not using_clang(env):
|
||||
# TODO: Implement for MSVC
|
||||
return ret
|
||||
|
||||
# Not using -dumpversion as some GCC distros only return major, and
|
||||
# Clang used to return hardcoded 4.2.1: # https://reviews.llvm.org/D56803
|
||||
try:
|
||||
version = subprocess.check_output(
|
||||
[env.subst(env["CXX"]), "--version"], shell=(os.name == "nt"), encoding="utf-8"
|
||||
).strip()
|
||||
except (subprocess.CalledProcessError, OSError):
|
||||
print_warning("Couldn't parse CXX environment variable to infer compiler version.")
|
||||
return ret
|
||||
|
||||
match = re.search(
|
||||
r"(?:(?<=version )|(?<=\) )|(?<=^))"
|
||||
r"(?P<major>\d+)"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue