#NEWLINE# def determine_base_flags( ) : #NEWLINE# #INDENT# flags = { #NEWLINE# #INDENT# 'libraries' : [ ] , #NEWLINE# 'include_dirs' : [ ] , #NEWLINE# 'extra_link_args' : [ ] , #NEWLINE# 'extra_compile_args' : [ ] , #NEWLINE# #UNINDENT# } #NEWLINE# if c_options [ 'use_ios' ] : #NEWLINE# #INDENT# sysroot = environ . get ( 'IOSSDKROOT' , environ . get ( 'SDKROOT' ) ) #NEWLINE# if ( not sysroot ) : #NEWLINE# #INDENT# raise Exception ( 'IOSSDKROOT is not set' ) #NEWLINE# #UNINDENT# flags [ 'include_dirs' ] += [ sysroot ] #NEWLINE# flags [ 'extra_compile_args' ] += [ '-isysroot' , sysroot ] #NEWLINE# flags [ 'extra_link_args' ] += [ '-isysroot' , sysroot ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if platform . startswith ( 'freebsd' ) : #NEWLINE# #INDENT# flags [ 'include_dirs' ] += [ join ( environ . get ( 'LOCALBASE' , '/usr/local' ) , 'include' ) ] #NEWLINE# flags [ 'extra_link_args' ] += [ '-L' , join ( environ . get ( 'LOCALBASE' , '/usr/local' ) , 'lib' ) ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( platform == 'darwin' ) : #NEWLINE# #INDENT# v = os . uname ( ) #NEWLINE# if ( v [ 2 ] >= '13.0.0' ) : #NEWLINE# #INDENT# import platform as _platform #NEWLINE# xcode_dev = getoutput ( 'xcode-select -p' ) . splitlines ( ) [ 0 ] #NEWLINE# sdk_mac_ver = '.' . join ( _platform . mac_ver ( ) [ 0 ] . split ( '.' ) [ : 2 ] ) #NEWLINE# print ( 'Xcode detected at {}, and using OS X{} sdk' . format ( xcode_dev , sdk_mac_ver ) ) #NEWLINE# sysroot = join ( xcode_dev . decode ( 'utf-8' ) , 'Platforms/MacOSX.platform/Developer/SDKs' , 'MacOSX{}.sdk' . format ( sdk_mac_ver ) , 'System/Library/Frameworks' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# sysroot = '/System/Library/Frameworks/ApplicationServices.framework/Frameworks' #NEWLINE# #UNINDENT# flags [ 'extra_compile_args' ] += [ ( '-F%s' % sysroot ) ] #NEWLINE# flags [ 'extra_link_args' ] += [ ( '-F%s' % sysroot ) ] #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return flags