SCsub 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #!/usr/bin/env python
  2. import build_scripts.mono_configure as mono_configure
  3. Import("env")
  4. Import("env_modules")
  5. env_mono = env_modules.Clone()
  6. if env_mono["tools"]:
  7. # NOTE: It is safe to generate this file here, since this is still executed serially
  8. import build_scripts.gen_cs_glue_version as gen_cs_glue_version
  9. gen_cs_glue_version.generate_header("glue/GodotSharp", "glue/cs_glue_version.gen.h")
  10. # Glue sources
  11. if env_mono["mono_glue"]:
  12. env_mono.Append(CPPDEFINES=["MONO_GLUE_ENABLED"])
  13. import os.path
  14. if not os.path.isfile("glue/mono_glue.gen.cpp"):
  15. raise RuntimeError("Mono glue sources not found. Did you forget to run '--generate-mono-glue'?")
  16. if env_mono["tools"] or env_mono["target"] != "release":
  17. env_mono.Append(CPPDEFINES=["GD_MONO_HOT_RELOAD"])
  18. # Configure Mono
  19. mono_configure.configure(env, env_mono)
  20. if env_mono["tools"] and env_mono["mono_glue"] and env_mono["build_cil"]:
  21. # Build Godot API solution
  22. import build_scripts.api_solution_build as api_solution_build
  23. api_sln_cmd = api_solution_build.build(env_mono)
  24. # Build GodotTools
  25. import build_scripts.godot_tools_build as godot_tools_build
  26. godot_tools_build.build(env_mono, api_sln_cmd)
  27. # Build Godot.NET.Sdk
  28. import build_scripts.godot_net_sdk_build as godot_net_sdk_build
  29. godot_net_sdk_build.build(env_mono)
  30. # Add sources
  31. env_mono.add_source_files(env.modules_sources, "*.cpp")
  32. env_mono.add_source_files(env.modules_sources, "glue/*.cpp")
  33. env_mono.add_source_files(env.modules_sources, "mono_gd/*.cpp")
  34. env_mono.add_source_files(env.modules_sources, "utils/*.cpp")
  35. env_mono.add_source_files(env.modules_sources, "mono_gd/support/*.cpp")
  36. if env["platform"] in ["osx", "iphone"]:
  37. env_mono.add_source_files(env.modules_sources, "mono_gd/support/*.mm")
  38. env_mono.add_source_files(env.modules_sources, "mono_gd/support/*.m")
  39. if env["tools"]:
  40. env_mono.add_source_files(env.modules_sources, "editor/*.cpp")