SCsub 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #!/usr/bin/env python
  2. Import("env")
  3. Import("env_modules")
  4. env_upnp = env_modules.Clone()
  5. # Thirdparty source files
  6. thirdparty_obj = []
  7. if env["builtin_miniupnpc"]:
  8. thirdparty_dir = "#thirdparty/miniupnpc/"
  9. thirdparty_sources = [
  10. "igd_desc_parse.c",
  11. "miniupnpc.c",
  12. "minixml.c",
  13. "minisoap.c",
  14. "minissdpc.c",
  15. "miniwget.c",
  16. "upnpcommands.c",
  17. "upnpdev.c",
  18. "upnpreplyparse.c",
  19. "connecthostport.c",
  20. "portlistingparse.c",
  21. "receivedata.c",
  22. "addr_is_reserved.c",
  23. ]
  24. thirdparty_sources = [thirdparty_dir + "src/" + file for file in thirdparty_sources]
  25. env_upnp.Prepend(CPPPATH=[thirdparty_dir + "include"])
  26. env_upnp.Append(CPPDEFINES=["MINIUPNP_STATICLIB"])
  27. env_upnp.Append(CPPDEFINES=["MINIUPNPC_SET_SOCKET_TIMEOUT"])
  28. env_thirdparty = env_upnp.Clone()
  29. env_thirdparty.disable_warnings()
  30. env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
  31. env.modules_sources += thirdparty_obj
  32. # Godot source files
  33. module_obj = []
  34. env_upnp.add_source_files(module_obj, "*.cpp")
  35. env.modules_sources += module_obj
  36. # Needed to force rebuilding the module files when the thirdparty library is updated.
  37. env.Depends(module_obj, thirdparty_obj)