SCsub 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. env.drivers_sources += neon_sources
  39. else:
  40. env_png.Append(CPPFLAGS=["-DPNG_ARM_NEON_OPT=0"])
  41. # Godot source files
  42. env_png.add_source_files(env.drivers_sources, "*.cpp")
  43. Export('env')