mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2025-04-14 23:58:26 +02:00
Workaround Xcode 15 linker bug.
This commit is contained in:
parent
51d6403385
commit
fa582212c4
11
methods.py
11
methods.py
@ -1116,6 +1116,17 @@ def get_compiler_version(env):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def is_vanilla_clang(env):
|
||||||
|
if not using_clang(env):
|
||||||
|
return False
|
||||||
|
try:
|
||||||
|
version = decode_utf8(subprocess.check_output([env.subst(env["CXX"]), "--version"]).strip())
|
||||||
|
except (subprocess.CalledProcessError, OSError):
|
||||||
|
print("Couldn't parse CXX environment variable to infer compiler version.")
|
||||||
|
return False
|
||||||
|
return not version.startswith("Apple")
|
||||||
|
|
||||||
|
|
||||||
def using_gcc(env):
|
def using_gcc(env):
|
||||||
return "gcc" in os.path.basename(env["CC"])
|
return "gcc" in os.path.basename(env["CC"])
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
from methods import detect_darwin_sdk_path
|
from methods import detect_darwin_sdk_path, get_compiler_version, is_vanilla_clang
|
||||||
|
|
||||||
|
|
||||||
def is_active():
|
def is_active():
|
||||||
@ -88,6 +88,13 @@ def configure(env):
|
|||||||
env.Append(CCFLAGS=["-arch", "x86_64", "-mmacosx-version-min=10.12"])
|
env.Append(CCFLAGS=["-arch", "x86_64", "-mmacosx-version-min=10.12"])
|
||||||
env.Append(LINKFLAGS=["-arch", "x86_64", "-mmacosx-version-min=10.12"])
|
env.Append(LINKFLAGS=["-arch", "x86_64", "-mmacosx-version-min=10.12"])
|
||||||
|
|
||||||
|
cc_version = get_compiler_version(env) or [-1, -1]
|
||||||
|
vanilla = is_vanilla_clang(env)
|
||||||
|
|
||||||
|
# Workaround for Xcode 15 linker bug.
|
||||||
|
if not vanilla and cc_version[0] == 15 and cc_version[1] == 0:
|
||||||
|
env.Prepend(LINKFLAGS=["-ld_classic"])
|
||||||
|
|
||||||
if not "osxcross" in env: # regular native build
|
if not "osxcross" in env: # regular native build
|
||||||
if env["macports_clang"] != "no":
|
if env["macports_clang"] != "no":
|
||||||
mpprefix = os.environ.get("MACPORTS_PREFIX", "/opt/local")
|
mpprefix = os.environ.get("MACPORTS_PREFIX", "/opt/local")
|
||||||
|
Loading…
Reference in New Issue
Block a user