detect.py 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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" or sys.platform == "darwin"):
  9. return False
  10. return True
  11. def get_opts():
  12. return [
  13. ('debug_release', 'Add debug symbols to release version', 'no')
  14. ]
  15. def get_flags():
  16. return [
  17. ]
  18. def configure(env):
  19. ## Build type
  20. if (env["target"] == "release"):
  21. if (env["debug_release"] == "yes"):
  22. env.Prepend(CCFLAGS=['-g2'])
  23. else:
  24. env.Prepend(CCFLAGS=['-O3', '-ffast-math'])
  25. elif (env["target"] == "release_debug"):
  26. env.Prepend(CCFLAGS=['-O2', '-ffast-math', '-DDEBUG_ENABLED'])
  27. elif (env["target"] == "debug"):
  28. env.Prepend(CCFLAGS=['-g2', '-DDEBUG_ENABLED', '-DDEBUG_MEMORY_ENABLED'])
  29. ## Architecture
  30. is64 = sys.maxsize > 2**32
  31. if (env["bits"] == "default"):
  32. env["bits"] = "64" if is64 else "32"
  33. ## Compiler configuration
  34. env["CC"] = "gcc-x86"
  35. env["CXX"] = "g++-x86"
  36. ## Flags
  37. env.Append(CPPPATH=['#platform/haiku'])
  38. env.Append(CPPFLAGS=['-DUNIX_ENABLED', '-DOPENGL_ENABLED', '-DGLES2_ENABLED', '-DGLES_OVER_GL'])
  39. env.Append(CPPFLAGS=['-DMEDIA_KIT_ENABLED'])
  40. # env.Append(CCFLAGS=['-DFREETYPE_ENABLED'])
  41. env.Append(CPPFLAGS=['-DPTHREAD_NO_RENAME']) # TODO: enable when we have pthread_setname_np
  42. env.Append(LIBS=['be', 'game', 'media', 'network', 'bnetapi', 'z', 'GL'])