detect.py 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. import os
  2. import sys
  3. def is_active():
  4. return False
  5. def get_name():
  6. return "iSIM"
  7. def can_build():
  8. import sys
  9. if sys.platform == 'darwin':
  10. return True
  11. return False
  12. def get_opts():
  13. return [
  14. ('ISIMPLATFORM', 'name of the iphone platform', 'iPhoneSimulator'),
  15. ('ISIMPATH', 'the path to iphone toolchain', '/Applications/Xcode.app/Contents/Developer/Platforms/${ISIMPLATFORM}.platform'),
  16. ('ISIMSDK', 'path to the iphone SDK', '$ISIMPATH/Developer/SDKs/${ISIMPLATFORM}.sdk'),
  17. ('game_center', 'Support for game center', 'yes'),
  18. ('store_kit', 'Support for in-app store', 'yes'),
  19. ('ios_gles22_override', 'Force GLES2.0 on iOS', 'yes'),
  20. ('ios_GLES1_override', 'Force legacy GLES (1.1) on iOS', 'no'),
  21. ('ios_appirater', 'Enable Appirater', 'no'),
  22. ('ios_exceptions', 'Use exceptions when compiling on playbook', 'no'),
  23. ]
  24. def get_flags():
  25. return [
  26. ('tools', 'yes'),
  27. ('webp', 'yes'),
  28. ]
  29. def configure(env):
  30. env.Append(CPPPATH=['#platform/iphone'])
  31. env['ENV']['PATH'] = env['ISIMPATH']+"/Developer/usr/bin/:"+env['ENV']['PATH']
  32. env['CC'] = '$ISIMPATH/Developer/usr/bin/gcc'
  33. env['CXX'] = '$ISIMPATH/Developer/usr/bin/g++'
  34. env['AR'] = 'ar'
  35. import string
  36. env['CCFLAGS'] = string.split('-arch i386 -fobjc-abi-version=2 -fobjc-legacy-dispatch -fmessage-length=0 -fpascal-strings -fasm-blocks -Wall -D__IPHONE_OS_VERSION_MIN_REQUIRED=40100 -isysroot $ISIMSDK -mios-simulator-version-min=4.3 -DCUSTOM_MATRIX_TRANSFORM_H=\\\"build/iphone/matrix4_iphone.h\\\" -DCUSTOM_VECTOR3_TRANSFORM_H=\\\"build/iphone/vector3_iphone.h\\\"')
  37. env.Append(LINKFLAGS=['-arch', 'i386',
  38. '-mios-simulator-version-min=4.3',
  39. '-isysroot', '$ISIMSDK',
  40. #'-mmacosx-version-min=10.6',
  41. '-Xlinker',
  42. '-objc_abi_version',
  43. '-Xlinker', '2',
  44. '-framework', 'AudioToolbox',
  45. '-framework', 'AVFoundation',
  46. '-framework', 'CoreAudio',
  47. '-framework', 'CoreGraphics',
  48. '-framework', 'CoreMedia',
  49. '-framework', 'Foundation',
  50. '-framework', 'Security',
  51. '-framework', 'UIKit',
  52. '-framework', 'MediaPlayer',
  53. '-framework', 'OpenGLES',
  54. '-framework', 'QuartzCore',
  55. '-framework', 'SystemConfiguration',
  56. '-F$ISIMSDK',
  57. ])
  58. env.Append(CPPPATH = ['$ISIMSDK/System/Library/Frameworks/OpenGLES.framework/Headers'])
  59. if (env["target"]=="release"):
  60. env.Append(CCFLAGS=['-O3', '-ffast-math'])
  61. env.Append(LINKFLAGS=['-O3', '-ffast-math'])
  62. elif (env["target"]=="debug"):
  63. env.Append(CCFLAGS=['-DDEBUG', '-D_DEBUG', '-gdwarf-2', '-Wall', '-O0', '-DDEBUG_ENABLED'])
  64. env.Append(CPPFLAGS=['-DDEBUG_MEMORY_ALLOC'])
  65. elif (env["target"]=="profile"):
  66. env.Append(CCFLAGS=['-g','-pg'])
  67. env.Append(LINKFLAGS=['-pg'])
  68. env['ENV']['MACOSX_DEPLOYMENT_TARGET'] = '10.6'
  69. env['ENV']['CODESIGN_ALLOCATE'] = '/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate'
  70. env.Append(CPPFLAGS=['-DIPHONE_ENABLED', '-DUNIX_ENABLED', '-DGLES2_ENABLED', '-fexceptions'])