SCsub 1015 B

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