detect.py 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. import os
  2. import sys
  3. def is_active():
  4. return True
  5. def get_name():
  6. return "Haiku"
  7. def can_build():
  8. if (os.name != "posix"):
  9. return False
  10. if (sys.platform == "darwin"):
  11. return False
  12. return True
  13. def get_opts():
  14. return [
  15. ('debug_release', 'Add debug symbols to release version', 'no')
  16. ]
  17. def get_flags():
  18. return [
  19. ]
  20. def configure(env):
  21. is64 = sys.maxsize > 2**32
  22. if (env["bits"] == "default"):
  23. if (is64):
  24. env["bits"] = "64"
  25. else:
  26. env["bits"] = "32"
  27. env.Append(CPPPATH=['#platform/haiku'])
  28. env["CC"] = "gcc-x86"
  29. env["CXX"] = "g++-x86"
  30. if (env["target"] == "release"):
  31. if (env["debug_release"] == "yes"):
  32. env.Append(CCFLAGS=['-g2'])
  33. else:
  34. env.Append(CCFLAGS=['-O3', '-ffast-math'])
  35. elif (env["target"] == "release_debug"):
  36. env.Append(CCFLAGS=['-O2', '-ffast-math', '-DDEBUG_ENABLED'])
  37. elif (env["target"] == "debug"):
  38. env.Append(CCFLAGS=['-g2', '-Wall', '-DDEBUG_ENABLED', '-DDEBUG_MEMORY_ENABLED'])
  39. # env.Append(CCFLAGS=['-DFREETYPE_ENABLED'])
  40. env.Append(CPPFLAGS=['-DPTHREAD_NO_RENAME']) # TODO: enable when we have pthread_setname_np
  41. env.Append(CPPFLAGS=['-DOPENGL_ENABLED', '-DMEDIA_KIT_ENABLED'])
  42. env.Append(CPPFLAGS=['-DUNIX_ENABLED', '-DGLES2_ENABLED', '-DGLES_OVER_GL'])
  43. env.Append(LIBS=['be', 'game', 'media', 'network', 'bnetapi', 'z', 'GL'])
  44. import methods
  45. env.Append(BUILDERS={'GLSL120': env.Builder(action=methods.build_legacygl_headers, suffix='glsl.h', src_suffix='.glsl')})
  46. env.Append(BUILDERS={'GLSL': env.Builder(action=methods.build_glsl_headers, suffix='glsl.h', src_suffix='.glsl')})
  47. env.Append(BUILDERS={'GLSL120GLES': env.Builder(action=methods.build_gles2_headers, suffix='glsl.h', src_suffix='.glsl')})