SCsub 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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/sdf.cpp",
  23. "src/smoothing.cpp",
  24. "src/sort.cpp",
  25. "src/subdivision.cpp",
  26. "src/tree2d.cpp",
  27. ]
  28. thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
  29. env_csg.Prepend(CPPPATH=[thirdparty_dir + "include"])
  30. env_thirdparty = env_csg.Clone()
  31. env_thirdparty.disable_warnings()
  32. env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
  33. env.modules_sources += thirdparty_obj
  34. # Godot source files
  35. module_obj = []
  36. env_csg.add_source_files(module_obj, "*.cpp")
  37. if env.editor_build:
  38. env_csg.add_source_files(module_obj, "editor/*.cpp")
  39. env.modules_sources += module_obj
  40. # Needed to force rebuilding the module files when the thirdparty library is updated.
  41. env.Depends(module_obj, thirdparty_obj)