config.py 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. supported_platforms = ["windows", "osx", "linuxbsd", "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.add_module_version_string("mono")
  9. from SCons.Script import BoolVariable, PathVariable, Variables, Help
  10. default_mono_static = platform in ["iphone", "javascript"]
  11. default_mono_bundles_zlib = platform in ["javascript"]
  12. envvars = Variables()
  13. envvars.Add(
  14. PathVariable(
  15. "mono_prefix",
  16. "Path to the Mono installation directory for the target platform and architecture",
  17. "",
  18. PathVariable.PathAccept,
  19. )
  20. )
  21. envvars.Add(
  22. PathVariable(
  23. "mono_bcl",
  24. "Path to a custom Mono BCL (Base Class Library) directory for the target platform",
  25. "",
  26. PathVariable.PathAccept,
  27. )
  28. )
  29. envvars.Add(BoolVariable("mono_static", "Statically link Mono", default_mono_static))
  30. envvars.Add(BoolVariable("mono_glue", "Build with the Mono glue sources", True))
  31. envvars.Add(BoolVariable("build_cil", "Build C# solutions", True))
  32. envvars.Add(
  33. BoolVariable("copy_mono_root", "Make a copy of the Mono installation directory to bundle with the editor", True)
  34. )
  35. # TODO: It would be great if this could be detected automatically instead
  36. envvars.Add(
  37. BoolVariable(
  38. "mono_bundles_zlib", "Specify if the Mono runtime was built with bundled zlib", default_mono_bundles_zlib
  39. )
  40. )
  41. envvars.Update(env)
  42. Help(envvars.GenerateHelpText(env))
  43. if env["mono_bundles_zlib"]:
  44. # Mono may come with zlib bundled for WASM or on newer version when built with MinGW.
  45. print("This Mono runtime comes with zlib bundled. Disabling 'builtin_zlib'...")
  46. env["builtin_zlib"] = False
  47. thirdparty_zlib_dir = "#thirdparty/zlib/"
  48. env.Prepend(CPPPATH=[thirdparty_zlib_dir])
  49. def get_doc_classes():
  50. return [
  51. "CSharpScript",
  52. "GodotSharp",
  53. ]
  54. def get_doc_path():
  55. return "doc_classes"
  56. def is_enabled():
  57. # The module is disabled by default. Use module_mono_enabled=yes to enable it.
  58. return False