2016-10-17 06:50:25 +00:00
|
|
|
#!/usr/bin/env python
|
2024-06-11 20:19:07 +00:00
|
|
|
from misc.utility.scons_hints import *
|
2016-10-17 06:50:25 +00:00
|
|
|
|
2020-03-30 06:28:32 +00:00
|
|
|
Import("env")
|
2015-05-03 21:18:56 +00:00
|
|
|
|
2016-10-30 17:57:40 +00:00
|
|
|
env.drivers_sources = []
|
2024-08-21 06:58:18 +00:00
|
|
|
supported = env.get("supported", [])
|
2016-05-21 23:07:32 +00:00
|
|
|
|
2016-10-15 10:39:28 +00:00
|
|
|
# OS drivers
|
2020-03-30 06:28:32 +00:00
|
|
|
SConscript("unix/SCsub")
|
|
|
|
SConscript("windows/SCsub")
|
2016-10-15 10:39:28 +00:00
|
|
|
|
|
|
|
# Sounds drivers
|
2020-03-30 06:28:32 +00:00
|
|
|
SConscript("alsa/SCsub")
|
|
|
|
SConscript("coreaudio/SCsub")
|
|
|
|
SConscript("pulseaudio/SCsub")
|
|
|
|
if env["platform"] == "windows":
|
2017-08-27 17:01:34 +00:00
|
|
|
SConscript("wasapi/SCsub")
|
2022-05-13 12:42:07 +00:00
|
|
|
if not env.msvc:
|
|
|
|
SConscript("backtrace/SCsub")
|
2020-03-30 06:28:32 +00:00
|
|
|
if env["xaudio2"]:
|
2024-08-21 06:58:18 +00:00
|
|
|
if "xaudio2" not in supported:
|
|
|
|
print("Target platform '{}' does not support the XAudio2 audio driver. Aborting.".format(env["platform"]))
|
|
|
|
Exit(255)
|
2016-10-31 23:24:30 +00:00
|
|
|
SConscript("xaudio2/SCsub")
|
2016-10-15 10:39:28 +00:00
|
|
|
|
2018-07-14 12:11:28 +00:00
|
|
|
# Midi drivers
|
2020-03-30 06:28:32 +00:00
|
|
|
SConscript("alsamidi/SCsub")
|
|
|
|
SConscript("coremidi/SCsub")
|
|
|
|
SConscript("winmidi/SCsub")
|
2018-07-14 12:11:28 +00:00
|
|
|
|
2016-10-15 10:39:28 +00:00
|
|
|
# Graphics drivers
|
2021-05-25 16:26:38 +00:00
|
|
|
if env["vulkan"]:
|
2020-03-30 06:28:32 +00:00
|
|
|
SConscript("vulkan/SCsub")
|
2023-01-09 15:56:16 +00:00
|
|
|
if env["d3d12"]:
|
2024-08-21 06:58:18 +00:00
|
|
|
if "d3d12" not in supported:
|
|
|
|
print("Target platform '{}' does not support the D3D12 rendering driver. Aborting.".format(env["platform"]))
|
|
|
|
Exit(255)
|
2023-01-09 15:56:16 +00:00
|
|
|
SConscript("d3d12/SCsub")
|
2021-10-25 17:16:40 +00:00
|
|
|
if env["opengl3"]:
|
2020-11-18 18:11:30 +00:00
|
|
|
SConscript("gl_context/SCsub")
|
2021-10-25 17:16:40 +00:00
|
|
|
SConscript("gles3/SCsub")
|
2021-11-12 12:49:49 +00:00
|
|
|
SConscript("egl/SCsub")
|
2024-02-19 18:52:00 +00:00
|
|
|
if env["metal"]:
|
2024-08-21 06:58:18 +00:00
|
|
|
if "metal" not in supported:
|
|
|
|
print("Target platform '{}' does not support the Metal rendering driver. Aborting.".format(env["platform"]))
|
|
|
|
Exit(255)
|
2024-02-19 18:52:00 +00:00
|
|
|
SConscript("metal/SCsub")
|
2015-05-03 21:18:56 +00:00
|
|
|
|
2016-10-15 10:39:28 +00:00
|
|
|
# Core dependencies
|
2016-10-31 23:24:30 +00:00
|
|
|
SConscript("png/SCsub")
|
2016-10-15 10:39:28 +00:00
|
|
|
|
2019-12-09 18:22:08 +00:00
|
|
|
env.add_source_files(env.drivers_sources, "*.cpp")
|
|
|
|
|
|
|
|
lib = env.add_library("drivers", env.drivers_sources)
|
|
|
|
env.Prepend(LIBS=[lib])
|