Skip to content

Commit 5db81a4

Browse files
authored
Merge pull request #6 from rgommers/extra-macos-check
Improve macOS version check in order to use Accelerate NEWLAPACK
2 parents 9864494 + dd86df3 commit 5db81a4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

mesonbuild/dependencies/blas_lapack.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import functools
1616
import os
1717
from pathlib import Path
18+
import platform
1819
import re
1920
import subprocess
2021
import sys
@@ -525,9 +526,12 @@ def __init__(self, name: str, environment: 'Environment', kwargs: T.Dict[str, T.
525526
self.detect(kwargs)
526527

527528
def check_macOS_recent_enough(self) -> bool:
529+
# We need the SDK to be >=13.3 (meaning at least XCode 14.3)
528530
cmd = ['xcrun', '-sdk', 'macosx', '--show-sdk-version']
529531
sdk_version = subprocess.run(cmd, capture_output=True, check=True, text=True).stdout.strip()
530-
return sdk_version >= '13.3'
532+
macos_version = platform.mac_ver()[0]
533+
deploy_target = os.environ.get('MACOSX_DEPLOYMENT_TARGET', macos_version)
534+
return sdk_version >= '13.3' and deploy_target >= '13.3'
531535

532536
def detect(self, kwargs: T.Dict[str, T.Any]) -> None:
533537
from .framework import ExtraFrameworkDependency

0 commit comments

Comments
 (0)