SCsub 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #!/usr/bin/env python
  2. from misc.utility.scons_hints import *
  3. from methods import print_error
  4. Import("env")
  5. env.drivers_sources = []
  6. supported = env.get("supported", [])
  7. # OS drivers
  8. SConscript("unix/SCsub")
  9. SConscript("windows/SCsub")
  10. # Sounds drivers
  11. SConscript("alsa/SCsub")
  12. if env["platform"] == "ios" or env["platform"] == "macos":
  13. SConscript("coreaudio/SCsub")
  14. SConscript("pulseaudio/SCsub")
  15. if env["platform"] == "windows":
  16. SConscript("wasapi/SCsub")
  17. if not env.msvc:
  18. SConscript("backtrace/SCsub")
  19. if env["xaudio2"]:
  20. if "xaudio2" not in supported:
  21. print_error("Target platform '{}' does not support the XAudio2 audio driver".format(env["platform"]))
  22. Exit(255)
  23. SConscript("xaudio2/SCsub")
  24. # Midi drivers
  25. SConscript("alsamidi/SCsub")
  26. SConscript("coremidi/SCsub")
  27. SConscript("winmidi/SCsub")
  28. # Graphics drivers
  29. if env["vulkan"]:
  30. SConscript("vulkan/SCsub")
  31. if env["d3d12"]:
  32. if "d3d12" not in supported:
  33. print_error("Target platform '{}' does not support the D3D12 rendering driver".format(env["platform"]))
  34. Exit(255)
  35. SConscript("d3d12/SCsub")
  36. if env["opengl3"]:
  37. SConscript("gl_context/SCsub")
  38. SConscript("gles3/SCsub")
  39. SConscript("egl/SCsub")
  40. if env["metal"]:
  41. if "metal" not in supported:
  42. print_error("Target platform '{}' does not support the Metal rendering driver".format(env["platform"]))
  43. Exit(255)
  44. SConscript("metal/SCsub")
  45. # Core dependencies
  46. SConscript("png/SCsub")
  47. env.add_source_files(env.drivers_sources, "*.cpp")
  48. lib = env.add_library("drivers", env.drivers_sources)
  49. env.Prepend(LIBS=[lib])