| 44 | |
| 45 | /// <inheritdoc /> |
| 46 | public override void Setup(BuildOptions options) |
| 47 | { |
| 48 | base.Setup(options); |
| 49 | |
| 50 | switch (options.Platform.Target) |
| 51 | { |
| 52 | case TargetPlatform.Windows: |
| 53 | options.PrivateDependencies.Add("GraphicsDeviceNull"); |
| 54 | options.PrivateDependencies.Add("GraphicsDeviceDX11"); |
| 55 | if (VulkanSdk.Instance.IsValid) |
| 56 | options.PrivateDependencies.Add("GraphicsDeviceVulkan"); |
| 57 | else |
| 58 | Log.WarningOnce(string.Format("Building for {0} without Vulkan rendering backend (Vulkan SDK is missing)", options.Platform.Target), ref _logMissingVulkanSDK); |
| 59 | var windowsToolchain = options.Toolchain as Flax.Build.Platforms.WindowsToolchain; |
| 60 | if (windowsToolchain != null && windowsToolchain.SDK != Flax.Build.Platforms.WindowsPlatformSDK.v8_1) |
| 61 | options.PrivateDependencies.Add("GraphicsDeviceDX12"); |
| 62 | else |
| 63 | Log.WarningOnce(string.Format("Building for {0} without D3D12 rendering backend (Windows SDK is missing)", options.Platform.Target), ref _logMissingWindowsSDK); |
| 64 | break; |
| 65 | case TargetPlatform.UWP: |
| 66 | options.PrivateDependencies.Add("GraphicsDeviceDX11"); |
| 67 | break; |
| 68 | case TargetPlatform.XboxOne: |
| 69 | case TargetPlatform.XboxScarlett: |
| 70 | options.PrivateDependencies.Add("GraphicsDeviceDX12"); |
| 71 | break; |
| 72 | case TargetPlatform.Linux: |
| 73 | options.PrivateDependencies.Add("GraphicsDeviceNull"); |
| 74 | if (VulkanSdk.Instance.IsValid) |
| 75 | options.PrivateDependencies.Add("GraphicsDeviceVulkan"); |
| 76 | else |
| 77 | Log.WarningOnce(string.Format("Building for {0} without Vulkan rendering backend (Vulkan SDK is missing)", options.Platform.Target), ref _logMissingVulkanSDK); |
| 78 | break; |
| 79 | case TargetPlatform.PS4: |
| 80 | options.PrivateDependencies.Add("GraphicsDevicePS4"); |
| 81 | break; |
| 82 | case TargetPlatform.PS5: |
| 83 | options.PrivateDependencies.Add("GraphicsDevicePS5"); |
| 84 | break; |
| 85 | case TargetPlatform.Android: |
| 86 | case TargetPlatform.iOS: |
| 87 | options.PrivateDependencies.Add("GraphicsDeviceVulkan"); |
| 88 | break; |
| 89 | case TargetPlatform.Switch: |
| 90 | options.PrivateDependencies.Add("GraphicsDeviceVulkan"); |
| 91 | break; |
| 92 | case TargetPlatform.Mac: |
| 93 | options.PrivateDependencies.Add("GraphicsDeviceNull"); |
| 94 | if (VulkanSdk.Instance.IsValid) |
| 95 | options.PrivateDependencies.Add("GraphicsDeviceVulkan"); |
| 96 | else |
| 97 | Log.WarningOnce(string.Format("Building for {0} without Vulkan rendering backend (Vulkan SDK is missing)", options.Platform.Target), ref _logMissingVulkanSDK); |
| 98 | break; |
| 99 | case TargetPlatform.Web: |
| 100 | options.PrivateDependencies.Add("GraphicsDeviceWebGPU"); |
| 101 | break; |
| 102 | default: throw new InvalidPlatformException(options.Platform.Target); |
| 103 | } |