1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-08 12:40:44 +00:00

Disable posix mode in shlex.split for windows

This commit is contained in:
KOGA Mitsuhiro
2025-06-17 03:29:53 +09:00
parent 46c495ca21
commit 88181c86b5

View File

@@ -665,7 +665,11 @@ def is_apple_clang(env):
if not using_clang(env): if not using_clang(env):
return False return False
try: try:
version = subprocess.check_output(shlex.split(env.subst(env["CXX"])) + ["--version"]).strip().decode("utf-8") version = (
subprocess.check_output(shlex.split(env.subst(env["CXX"]), posix=False) + ["--version"])
.strip()
.decode("utf-8")
)
except (subprocess.CalledProcessError, OSError): except (subprocess.CalledProcessError, OSError):
print_warning("Couldn't parse CXX environment variable to infer compiler version.") print_warning("Couldn't parse CXX environment variable to infer compiler version.")
return False return False
@@ -737,7 +741,7 @@ def get_compiler_version(env):
# Clang used to return hardcoded 4.2.1: # https://reviews.llvm.org/D56803 # Clang used to return hardcoded 4.2.1: # https://reviews.llvm.org/D56803
try: try:
version = subprocess.check_output( version = subprocess.check_output(
shlex.split(env.subst(env["CXX"])) + ["--version"], shell=(os.name == "nt"), encoding="utf-8" shlex.split(env.subst(env["CXX"]), posix=False) + ["--version"], shell=(os.name == "nt"), encoding="utf-8"
).strip() ).strip()
except (subprocess.CalledProcessError, OSError): except (subprocess.CalledProcessError, OSError):
print_warning("Couldn't parse CXX environment variable to infer compiler version.") print_warning("Couldn't parse CXX environment variable to infer compiler version.")