SCsub 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #!/usr/bin/env python
  2. Import("env")
  3. Import("env_modules")
  4. env_navigation = env_modules.Clone()
  5. # Thirdparty source files
  6. thirdparty_obj = []
  7. # Recast
  8. if env["builtin_recast"]:
  9. thirdparty_dir = "#thirdparty/recastnavigation/Recast/"
  10. thirdparty_sources = [
  11. "Source/Recast.cpp",
  12. "Source/RecastAlloc.cpp",
  13. "Source/RecastArea.cpp",
  14. "Source/RecastAssert.cpp",
  15. "Source/RecastContour.cpp",
  16. "Source/RecastFilter.cpp",
  17. "Source/RecastLayers.cpp",
  18. "Source/RecastMesh.cpp",
  19. "Source/RecastMeshDetail.cpp",
  20. "Source/RecastRasterization.cpp",
  21. "Source/RecastRegion.cpp",
  22. ]
  23. thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
  24. env_navigation.Prepend(CPPPATH=[thirdparty_dir + "Include"])
  25. env_thirdparty = env_navigation.Clone()
  26. env_thirdparty.disable_warnings()
  27. env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
  28. env.modules_sources += thirdparty_obj
  29. # RVO2
  30. if env["builtin_rvo2"]:
  31. thirdparty_dir = "#thirdparty/rvo2/"
  32. thirdparty_sources = [
  33. "Agent.cpp",
  34. "KdTree.cpp",
  35. ]
  36. thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
  37. env_navigation.Prepend(CPPPATH=[thirdparty_dir])
  38. env_thirdparty = env_navigation.Clone()
  39. env_thirdparty.disable_warnings()
  40. env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
  41. env.modules_sources += thirdparty_obj
  42. # Godot source files
  43. module_obj = []
  44. env_navigation.add_source_files(module_obj, "*.cpp")
  45. env.modules_sources += module_obj
  46. # Needed to force rebuilding the module files when the thirdparty library is updated.
  47. env.Depends(module_obj, thirdparty_obj)