summaryrefslogtreecommitdiffstats
path: root/platform/macos/detect.py
diff options
context:
space:
mode:
Diffstat (limited to 'platform/macos/detect.py')
-rw-r--r--platform/macos/detect.py14
1 files changed, 4 insertions, 10 deletions
diff --git a/platform/macos/detect.py b/platform/macos/detect.py
index a8968b592e..3575e93c68 100644
--- a/platform/macos/detect.py
+++ b/platform/macos/detect.py
@@ -2,8 +2,8 @@ import os
import sys
from typing import TYPE_CHECKING
-from methods import detect_darwin_sdk_path, get_compiler_version, is_vanilla_clang, print_error, print_warning
-from platform_methods import detect_arch, detect_mvk
+from methods import detect_darwin_sdk_path, get_compiler_version, is_apple_clang, print_error, print_warning
+from platform_methods import detect_arch, detect_mvk, validate_arch
if TYPE_CHECKING:
from SCons.Script.SConscript import SConsEnvironment
@@ -68,12 +68,7 @@ def get_flags():
def configure(env: "SConsEnvironment"):
# Validate arch.
supported_arches = ["x86_64", "arm64"]
- if env["arch"] not in supported_arches:
- print_error(
- 'Unsupported CPU architecture "%s" for macOS. Supported architectures are: %s.'
- % (env["arch"], ", ".join(supported_arches))
- )
- sys.exit(255)
+ validate_arch(env["arch"], get_name(), supported_arches)
## Build type
@@ -106,10 +101,9 @@ def configure(env: "SConsEnvironment"):
cc_version = get_compiler_version(env)
cc_version_major = cc_version["apple_major"]
cc_version_minor = cc_version["apple_minor"]
- vanilla = is_vanilla_clang(env)
# Workaround for Xcode 15 linker bug.
- if not vanilla and cc_version_major == 1500 and cc_version_minor == 0:
+ if is_apple_clang(env) and cc_version_major == 1500 and cc_version_minor == 0:
env.Prepend(LINKFLAGS=["-ld_classic"])
env.Append(CCFLAGS=["-fobjc-arc"])