config.py 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. supported_platforms = ['windows', 'osx', 'x11', 'server', 'android', 'haiku', 'javascript', 'iphone']
  2. def can_build(env, platform):
  3. return True
  4. def configure(env):
  5. platform = env['platform']
  6. if platform not in supported_platforms:
  7. raise RuntimeError('This module does not currently support building for this platform')
  8. env.use_ptrcall = True
  9. env.add_module_version_string('mono')
  10. from SCons.Script import BoolVariable, PathVariable, Variables, Help
  11. default_mono_static = platform in ['iphone', 'javascript']
  12. default_mono_bundles_zlib = platform in ['javascript']
  13. envvars = Variables()
  14. envvars.Add(
  15. PathVariable(
  16. "mono_prefix",
  17. "Path to the mono installation directory for the target platform and architecture",
  18. "",
  19. PathVariable.PathAccept,
  20. )
  21. )
  22. envvars.Add(BoolVariable("mono_static", "Statically link mono", default_mono_static))
  23. envvars.Add(BoolVariable("mono_glue", "Build with the mono glue sources", True))
  24. envvars.Add(
  25. BoolVariable(
  26. "copy_mono_root", "Make a copy of the mono installation directory to bundle with the editor", False
  27. )
  28. )
  29. # TODO: It would be great if this could be detected automatically instead
  30. envvars.Add(BoolVariable('mono_bundles_zlib', 'Specify if the Mono runtime was built with bundled zlib', default_mono_bundles_zlib))
  31. envvars.Update(env)
  32. Help(envvars.GenerateHelpText(env))
  33. if env['mono_bundles_zlib']:
  34. # Mono may come with zlib bundled for WASM or on newer version when built with MinGW.
  35. print('This Mono runtime comes with zlib bundled. Disabling \'builtin_zlib\'...')
  36. env['builtin_zlib'] = False
  37. thirdparty_zlib_dir = "#thirdparty/zlib/"
  38. env.Prepend(CPPPATH=[thirdparty_zlib_dir])
  39. def get_doc_classes():
  40. return [
  41. '@C#',
  42. 'CSharpScript',
  43. 'GodotSharp',
  44. ]
  45. def get_doc_path():
  46. return 'doc_classes'
  47. def is_enabled():
  48. # The module is disabled by default. Use module_mono_enabled=yes to enable it.
  49. return False