SCsub 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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 Thirdparty source files
  8. if env["builtin_recastnavigation"]:
  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. # RVO Thirdparty source files
  29. if env["builtin_rvo2"]:
  30. thirdparty_dir = "#thirdparty/rvo2/"
  31. thirdparty_sources = [
  32. "Agent.cpp",
  33. "KdTree.cpp",
  34. ]
  35. thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
  36. env_navigation.Prepend(CPPPATH=[thirdparty_dir])
  37. env_thirdparty = env_navigation.Clone()
  38. env_thirdparty.disable_warnings()
  39. env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
  40. env.modules_sources += thirdparty_obj
  41. # Godot source files
  42. module_obj = []
  43. env_navigation.add_source_files(module_obj, "*.cpp")
  44. if env.editor_build:
  45. env_navigation.add_source_files(module_obj, "editor/*.cpp")
  46. env.modules_sources += module_obj
  47. # Needed to force rebuilding the module files when the thirdparty library is updated.
  48. env.Depends(module_obj, thirdparty_obj)