diff --git a/dist/platforms/windows/build.ps1 b/dist/platforms/windows/build.ps1 index f0c3702c..ac78d62b 100644 --- a/dist/platforms/windows/build.ps1 +++ b/dist/platforms/windows/build.ps1 @@ -148,13 +148,20 @@ Write-Output "# Building project #" Write-Output "###########################" Write-Output "" +$unityGraphics = "-nographics" + +if ($LLVMPIPE_INSTALLED -eq "true") +{ + $unityGraphics = "-force-opengl" +} + # If $Env:CUSTOM_PARAMETERS contains spaces and is passed directly on the command line to Unity, powershell will wrap it # in double quotes. To avoid this, parse $Env:CUSTOM_PARAMETERS into an array, while respecting any quotations within the string. $_, $customParametersArray = Invoke-Expression('Write-Output -- "" ' + $Env:CUSTOM_PARAMETERS) $unityArgs = @( "-quit", "-batchmode", - ($Env:LLVMPIPE_INSTALLED -eq "true" ? "-force-opengl" : "-nographics"), + $unityGraphics, "-silent-crashes", "-customBuildName", "`"$Env:BUILD_NAME`"", "-projectPath", "`"$Env:UNITY_PROJECT_PATH`"",