SCsub 1.1 KB

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