Respect SDKROOT and use_osx_frameworks

This commit is contained in:
matham 2020-10-15 13:12:34 -04:00 committed by GitHub
parent d74461b200
commit e49fbcbce4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 13 deletions

View File

@ -600,9 +600,12 @@ def determine_base_flags():
environ.get('LOCALBASE', '/usr/local'), 'include')]
flags['library_dirs'] += [join(
environ.get('LOCALBASE', '/usr/local'), 'lib')]
elif platform == 'darwin':
elif platform == 'darwin' and c_options['use_osx_frameworks']:
v = os.uname()
if v[2] >= '13.0.0':
if 'SDKROOT' in environ:
sysroot = join(environ['SDKROOT'], 'System/Library/Frameworks')
else:
# use xcode-select to search on the right Xcode path
# XXX use the best SDK available instead of a specific one
import platform as _platform