0.2.0-dev Download ZIP
75 lines ·2.2 KB Raw
| 1 | #!/usr/bin/env python |
| 2 | from misc.utility.scons_hints import * |
| 3 | |
| 4 | from methods import print_error |
| 5 | |
| 6 | Import("env") |
| 7 | |
| 8 | env.drivers_sources = [] |
| 9 | supported = env.get("supported", []) |
| 10 | |
| 11 | # OS drivers |
| 12 | SConscript("unix/SCsub") |
| 13 | SConscript("windows/SCsub") |
| 14 | |
| 15 | # Sounds drivers |
| 16 | SConscript("alsa/SCsub") |
| 17 | SConscript("pulseaudio/SCsub") |
| 18 | if env["platform"] == "windows": |
| 19 | SConscript("wasapi/SCsub") |
| 20 | if not env.msvc: |
| 21 | SConscript("backtrace/SCsub") |
| 22 | if env["xaudio2"]: |
| 23 | if "xaudio2" not in supported: |
| 24 | print_error("Target platform '{}' does not support the XAudio2 audio driver".format(env["platform"])) |
| 25 | Exit(255) |
| 26 | SConscript("xaudio2/SCsub") |
| 27 | |
| 28 | # Shared Apple platform drivers |
| 29 | if env["platform"] in ["macos", "ios", "visionos"]: |
| 30 | SConscript("apple/SCsub") |
| 31 | SConscript("coreaudio/SCsub") |
| 32 | if env["platform"] in ["ios", "visionos"]: |
| 33 | SConscript("apple_embedded/SCsub") |
| 34 | |
| 35 | # Accessibility |
| 36 | if env["accesskit"] and env["platform"] in ["macos", "windows", "linuxbsd", "android", "ios"]: |
| 37 | SConscript("accesskit/SCsub") |
| 38 | |
| 39 | # Midi drivers |
| 40 | SConscript("alsamidi/SCsub") |
| 41 | if env["platform"] in ["macos"]: |
| 42 | SConscript("coremidi/SCsub") |
| 43 | SConscript("winmidi/SCsub") |
| 44 | |
| 45 | # Graphics drivers |
| 46 | if env["rendering_device"]: |
| 47 | if env["vulkan"]: |
| 48 | SConscript("vulkan/SCsub") |
| 49 | if env["d3d12"]: |
| 50 | if "d3d12" not in supported: |
| 51 | print_error("Target platform '{}' does not support the D3D12 rendering driver".format(env["platform"])) |
| 52 | Exit(255) |
| 53 | SConscript("d3d12/SCsub") |
| 54 | if env["metal"]: |
| 55 | if "metal" not in supported: |
| 56 | print_error("Target platform '{}' does not support the Metal rendering driver".format(env["platform"])) |
| 57 | Exit(255) |
| 58 | SConscript("metal/SCsub") |
| 59 | if env["opengl3"]: |
| 60 | SConscript("gl_context/SCsub") |
| 61 | SConscript("gles3/SCsub") |
| 62 | SConscript("egl/SCsub") |
| 63 | |
| 64 | # Input drivers |
| 65 | if env["sdl"] and env["platform"] in ["linuxbsd", "macos", "windows", "ios", "visionos"]: |
| 66 | # TODO: Evaluate support for Android and Web. |
| 67 | SConscript("sdl/SCsub") |
| 68 | |
| 69 | # Core dependencies |
| 70 | SConscript("png/SCsub") |
| 71 | |
| 72 | env.add_source_files(env.drivers_sources, "*.cpp") |
| 73 | |
| 74 | lib = env.add_library("drivers", env.drivers_sources) |
| 75 | env.Prepend(LIBS=[lib]) |