SCsub 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #!/usr/bin/env python
  2. from misc.utility.scons_hints import *
  3. Import("env")
  4. Import("env_modules")
  5. env_csg = env_modules.Clone()
  6. env_csg.Append(CPPDEFINES=("MANIFOLD_PAR", "-1"))
  7. # Thirdparty source files
  8. thirdparty_obj = []
  9. thirdparty_dir = "#thirdparty/manifold/"
  10. thirdparty_sources = [
  11. "src/boolean_result.cpp",
  12. "src/boolean3.cpp",
  13. "src/constructors.cpp",
  14. "src/csg_tree.cpp",
  15. "src/edge_op.cpp",
  16. "src/face_op.cpp",
  17. "src/impl.cpp",
  18. "src/manifold.cpp",
  19. "src/polygon.cpp",
  20. "src/properties.cpp",
  21. "src/quickhull.cpp",
  22. "src/smoothing.cpp",
  23. "src/sort.cpp",
  24. "src/subdivision.cpp",
  25. ]
  26. thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
  27. env_csg.Prepend(CPPPATH=[thirdparty_dir + "include"])
  28. env_thirdparty = env_csg.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_csg.add_source_files(module_obj, "*.cpp")
  35. if env.editor_build:
  36. env_csg.add_source_files(module_obj, "editor/*.cpp")
  37. env.modules_sources += module_obj
  38. # Needed to force rebuilding the module files when the thirdparty library is updated.
  39. env.Depends(module_obj, thirdparty_obj)