SCsub 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. #!/usr/bin/env python
  2. from misc.utility.scons_hints import *
  3. Import("env")
  4. Import("env_modules")
  5. env_navigation = env_modules.Clone()
  6. # Thirdparty source files
  7. thirdparty_obj = []
  8. # Recast Thirdparty source files
  9. if env["builtin_recastnavigation"]:
  10. thirdparty_dir = "#thirdparty/recastnavigation/Recast/"
  11. thirdparty_sources = [
  12. "Source/Recast.cpp",
  13. "Source/RecastAlloc.cpp",
  14. "Source/RecastArea.cpp",
  15. "Source/RecastAssert.cpp",
  16. "Source/RecastContour.cpp",
  17. "Source/RecastFilter.cpp",
  18. "Source/RecastLayers.cpp",
  19. "Source/RecastMesh.cpp",
  20. "Source/RecastMeshDetail.cpp",
  21. "Source/RecastRasterization.cpp",
  22. "Source/RecastRegion.cpp",
  23. ]
  24. thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
  25. env_navigation.Prepend(CPPPATH=[thirdparty_dir + "Include"])
  26. env_thirdparty = env_navigation.Clone()
  27. env_thirdparty.disable_warnings()
  28. env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
  29. # RVO 2D Thirdparty source files
  30. if env["builtin_rvo2_2d"]:
  31. thirdparty_dir = "#thirdparty/rvo2/rvo2_2d/"
  32. thirdparty_sources = [
  33. "Agent2d.cpp",
  34. "Obstacle2d.cpp",
  35. "KdTree2d.cpp",
  36. "RVOSimulator2d.cpp",
  37. ]
  38. thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
  39. env_navigation.Prepend(CPPPATH=[thirdparty_dir])
  40. env_thirdparty = env_navigation.Clone()
  41. env_thirdparty.disable_warnings()
  42. env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
  43. # RVO 3D Thirdparty source files
  44. if env["builtin_rvo2_3d"]:
  45. thirdparty_dir = "#thirdparty/rvo2/rvo2_3d/"
  46. thirdparty_sources = [
  47. "Agent3d.cpp",
  48. "KdTree3d.cpp",
  49. "RVOSimulator3d.cpp",
  50. ]
  51. thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
  52. env_navigation.Prepend(CPPPATH=[thirdparty_dir])
  53. env_thirdparty = env_navigation.Clone()
  54. env_thirdparty.disable_warnings()
  55. env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
  56. env.modules_sources += thirdparty_obj
  57. # Godot source files
  58. module_obj = []
  59. env_navigation.add_source_files(module_obj, "*.cpp")
  60. env_navigation.add_source_files(module_obj, "2d/*.cpp")
  61. if not env["disable_3d"]:
  62. env_navigation.add_source_files(module_obj, "3d/*.cpp")
  63. if env.editor_build:
  64. env_navigation.add_source_files(module_obj, "editor/*.cpp")
  65. env.modules_sources += module_obj
  66. # Needed to force rebuilding the module files when the thirdparty library is updated.
  67. env.Depends(module_obj, thirdparty_obj)