SCsub 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #!/usr/bin/env python
  2. Import('env')
  3. env_png = env.Clone()
  4. # Thirdparty source files
  5. if env['builtin_libpng']:
  6. thirdparty_dir = "#thirdparty/libpng/"
  7. thirdparty_sources = [
  8. "png.c",
  9. "pngerror.c",
  10. "pngget.c",
  11. "pngmem.c",
  12. "pngpread.c",
  13. "pngread.c",
  14. "pngrio.c",
  15. "pngrtran.c",
  16. "pngrutil.c",
  17. "pngset.c",
  18. "pngtrans.c",
  19. "pngwio.c",
  20. "pngwrite.c",
  21. "pngwtran.c",
  22. "pngwutil.c",
  23. ]
  24. thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
  25. env_png.add_source_files(env.drivers_sources, thirdparty_sources)
  26. env_png.Append(CPPPATH=[thirdparty_dir])
  27. # Currently .ASM filter_neon.S does not compile on NT.
  28. import os
  29. if ("neon_enabled" in env and env["neon_enabled"]) and os.name != "nt":
  30. env_png.Append(CPPFLAGS=["-DPNG_ARM_NEON_OPT=2"])
  31. env_neon = env_png.Clone()
  32. if "S_compiler" in env:
  33. env_neon['CC'] = env['S_compiler']
  34. neon_sources = []
  35. neon_sources.append(env_neon.Object(thirdparty_dir + "/arm/arm_init.c"))
  36. neon_sources.append(env_neon.Object(thirdparty_dir + "/arm/filter_neon_intrinsics.c"))
  37. neon_sources.append(env_neon.Object(thirdparty_dir + "/arm/filter_neon.S"))
  38. neon_sources.append(env_neon.Object(thirdparty_dir + "/arm/palette_neon_intrinsics.c"))
  39. env.drivers_sources += neon_sources
  40. else:
  41. env_png.Append(CPPFLAGS=["-DPNG_ARM_NEON_OPT=0"])
  42. # Godot source files
  43. env_png.add_source_files(env.drivers_sources, "*.cpp")
  44. Export('env')