summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-09-20 18:55:25 +0200
committerRémi Verschelde <rverschelde@gmail.com>2023-09-20 18:55:25 +0200
commit58750df3a3095201040e56d8947053261c9eaf75 (patch)
tree4849b8d0858e0a546ea9f5cdb4990a9bede23d99
parent0c71c7cc6f21c5a7b89b0409c60a3311e50da1ad (diff)
parent6da8c7a6629a51aeb0fa8ca7922e48617d88aad2 (diff)
downloadredot-engine-58750df3a3095201040e56d8947053261c9eaf75.tar.gz
Merge pull request #81968 from bruvzg/xc15_ld_bug
[macOS] Workaround Xcode 15 linker bug.
-rw-r--r--platform/macos/detect.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/platform/macos/detect.py b/platform/macos/detect.py
index 21e824b2d3..6abe121407 100644
--- a/platform/macos/detect.py
+++ b/platform/macos/detect.py
@@ -1,6 +1,6 @@
import os
import sys
-from methods import detect_darwin_sdk_path
+from methods import detect_darwin_sdk_path, get_compiler_version, is_vanilla_clang
from platform_methods import detect_arch
from typing import TYPE_CHECKING
@@ -119,6 +119,22 @@ def configure(env: "Environment"):
env.Append(CCFLAGS=["-arch", "x86_64", "-mmacosx-version-min=10.13"])
env.Append(LINKFLAGS=["-arch", "x86_64", "-mmacosx-version-min=10.13"])
+ cc_version = get_compiler_version(env) or {
+ "major": None,
+ "minor": None,
+ "patch": None,
+ "metadata1": None,
+ "metadata2": None,
+ "date": None,
+ }
+ cc_version_major = int(cc_version["major"] or -1)
+ cc_version_minor = int(cc_version["minor"] or -1)
+ vanilla = is_vanilla_clang(env)
+
+ # Workaround for Xcode 15 linker bug.
+ if not vanilla and cc_version_major == 15 and cc_version_minor == 0:
+ env.Prepend(LINKFLAGS=["-ld_classic"])
+
env.Append(CCFLAGS=["-fobjc-arc"])
if not "osxcross" in env: # regular native build