mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Improving detection of ccache on Mac
Before this commit, ccache where only used on Mac when `OSXCROSS_ROOT` was defined. Now, it could be used even when that envirnment variable is not defined.
This commit is contained in:
parent
19e003bc08
commit
7c4c1100e0
2 changed files with 14 additions and 13 deletions
|
@ -657,12 +657,14 @@ def detect_darwin_sdk_path(platform, env):
|
|||
|
||||
|
||||
def is_apple_clang(env):
|
||||
import shlex
|
||||
|
||||
if env["platform"] not in ["macos", "ios"]:
|
||||
return False
|
||||
if not using_clang(env):
|
||||
return False
|
||||
try:
|
||||
version = subprocess.check_output([env.subst(env["CXX"]), "--version"]).strip().decode("utf-8")
|
||||
version = subprocess.check_output(shlex.split(env.subst(env["CXX"])) + ["--version"]).strip().decode("utf-8")
|
||||
except (subprocess.CalledProcessError, OSError):
|
||||
print_warning("Couldn't parse CXX environment variable to infer compiler version.")
|
||||
return False
|
||||
|
@ -677,6 +679,8 @@ def get_compiler_version(env):
|
|||
- metadata1, metadata2: Extra information
|
||||
- date: Date of the build
|
||||
"""
|
||||
import shlex
|
||||
|
||||
ret = {
|
||||
"major": -1,
|
||||
"minor": -1,
|
||||
|
@ -727,7 +731,7 @@ def get_compiler_version(env):
|
|||
# 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"
|
||||
shlex.split(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.")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue