SCsub 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #!/usr/bin/env python
  2. Import("env")
  3. Import("env_modules")
  4. env_fbx = env_modules.Clone()
  5. # Thirdparty source files
  6. thirdparty_obj = []
  7. thirdparty_dir = "#thirdparty/ufbx/"
  8. thirdparty_sources = [thirdparty_dir + "ufbx.c"]
  9. env_fbx.Prepend(CPPPATH=[thirdparty_dir])
  10. env_thirdparty = env_fbx.Clone()
  11. env_thirdparty.disable_warnings()
  12. env_thirdparty.Append(
  13. CPPDEFINES=[
  14. "UFBX_NO_SUBDIVISION",
  15. "UFBX_NO_TESSELLATION",
  16. "UFBX_NO_GEOMETRY_CACHE",
  17. "UFBX_NO_SCENE_EVALUATION",
  18. "UFBX_NO_INDEX_GENERATION",
  19. "UFBX_NO_SKINNING_EVALUATION",
  20. "UFBX_NO_FORMAT_OBJ",
  21. ]
  22. )
  23. env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
  24. env.modules_sources += thirdparty_obj
  25. # Godot source files
  26. module_obj = []
  27. env_fbx.add_source_files(module_obj, "*.cpp")
  28. env_fbx.add_source_files(module_obj, "structures/*.cpp")
  29. if env.editor_build:
  30. env_fbx.add_source_files(module_obj, "editor/*.cpp")
  31. env.modules_sources += module_obj
  32. # Needed to force rebuilding the module files when the thirdparty library is updated.
  33. env.Depends(module_obj, thirdparty_obj)