SCsub 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/usr/bin/env python
  2. from misc.utility.scons_hints import *
  3. Import("env")
  4. Import("env_modules")
  5. env_enet = env_modules.Clone()
  6. # Thirdparty source files
  7. thirdparty_obj = []
  8. if env["builtin_enet"]:
  9. thirdparty_dir = "#thirdparty/enet/"
  10. thirdparty_sources = [
  11. "godot.cpp",
  12. "callbacks.c",
  13. "compress.c",
  14. "host.c",
  15. "list.c",
  16. "packet.c",
  17. "peer.c",
  18. "protocol.c",
  19. ]
  20. thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
  21. env_enet.Prepend(CPPPATH=[thirdparty_dir])
  22. env_enet.Append(CPPDEFINES=["GODOT_ENET"])
  23. env_thirdparty = env_enet.Clone()
  24. env_thirdparty.disable_warnings()
  25. env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
  26. env.modules_sources += thirdparty_obj
  27. # Godot source files
  28. module_obj = []
  29. env_enet.add_source_files(module_obj, "*.cpp")
  30. env.modules_sources += module_obj
  31. # Needed to force rebuilding the module files when the thirdparty library is updated.
  32. env.Depends(module_obj, thirdparty_obj)