##
import os
import platform
+import commands
Import('env')
+target_arch = env.get('TARGET_ARCH')
+target_os = env.get('TARGET_OS')
+
+tc_path=commands.getoutput('xcode-select -p')
+
+
# SYS_VERSION build option
help_vars = Variables()
help_vars.Add('SYS_VERSION', 'MAC OS X version / IOS version', os.environ.get('SYS_VERSION'))
'''
Exit(1)
-target_arch = env.get('TARGET_ARCH')
-target_os = env.get('TARGET_OS')
# Set release/debug flags
if env.get('RELEASE'):
env.AppendUnique(CCFLAGS = ['-Os'])
env.AppendUnique(LINKFLAGS = ['-g'])
if target_os == 'darwin':
- sys_root = '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX' + sys_version + '.sdk/'
+ sys_root = tc_path + '/Platforms/MacOSX.platform/Developer/SDKs/MacOSX' + sys_version + '.sdk/'
else:
if target_arch in ['i386', 'x86_64']:
- sys_root = '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator' + sys_version + '.sdk/'
+ sys_root = tc_path + '/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator' + sys_version + '.sdk/'
else:
- sys_root = '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS' + sys_version + '.sdk/'
+ sys_root = tc_path + '/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS' + sys_version + '.sdk/'
# Set arch flags
env.AppendUnique(CCFLAGS = ['-arch', target_arch, '-isysroot', sys_root])