SCsub 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #!/usr/bin/env python
  2. Import('env')
  3. Import('env_modules')
  4. env_etc = env_modules.Clone()
  5. # Thirdparty source files
  6. # Not unbundled so far since not widespread as shared library
  7. thirdparty_dir = "#thirdparty/etc2comp/"
  8. thirdparty_sources = [
  9. "EtcBlock4x4.cpp",
  10. "EtcBlock4x4Encoding.cpp",
  11. "EtcBlock4x4Encoding_ETC1.cpp",
  12. "EtcBlock4x4Encoding_R11.cpp",
  13. "EtcBlock4x4Encoding_RG11.cpp",
  14. "EtcBlock4x4Encoding_RGB8A1.cpp",
  15. "EtcBlock4x4Encoding_RGB8.cpp",
  16. "EtcBlock4x4Encoding_RGBA8.cpp",
  17. "Etc.cpp",
  18. "EtcDifferentialTrys.cpp",
  19. "EtcFilter.cpp",
  20. "EtcImage.cpp",
  21. "EtcIndividualTrys.cpp",
  22. "EtcMath.cpp",
  23. "EtcSortedBlockList.cpp",
  24. ]
  25. thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
  26. env_etc.Append(CPPPATH=[thirdparty_dir])
  27. # upstream uses c++11
  28. if not env.msvc:
  29. env_etc.Append(CCFLAGS="-std=c++11")
  30. # -ffast-math seems to be incompatible with etc2comp on recent versions of
  31. # GCC and Clang
  32. if '-ffast-math' in env_etc['CCFLAGS']:
  33. env_etc['CCFLAGS'].remove('-ffast-math')
  34. env_thirdparty = env_etc.Clone()
  35. env_thirdparty.disable_warnings()
  36. env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources)
  37. # Godot source files
  38. env_etc.add_source_files(env.modules_sources, "*.cpp")