@@ -108,47 +108,20 @@ function Build([string]$configuration, [int]$VsVersion , [bool]$runBuild) {
108108 Write-Host " Building $systemName $architecture $configuration "
109109
110110 [string ]$BuildDirectoryNameExtension = If ($isMultipleConfig ) { " MultiConfig" } Else { $configuration }
111- [string ]$BuildDirectoryName = " ../" + " builds/renderengine/Result. " + $systemName + " . " + $architecture + " . " + $BuildDirectoryNameExtension
111+ [string ]$BuildDirectoryName = " ../" + " builds/renderengine"
112112 [string ]$buildDirectoryPath = [IO.Path ]::Combine($RepoRoot , $BuildDirectoryName )
113113 [string ]$cMakeCacheVariableOverride = " "
114- [string ]$cMakeGenerator = " "
114+ [string ]$cMakeGenerator = " Ninja "
115115
116116 # Create build directory
117117 if (-Not (Test-Path $buildDirectoryPath )) {
118118 $Null = New-Item - ItemType Directory - Path $BuildDirectoryPath - ErrorAction SilentlyContinue
119119 }
120120
121121 # Define CMake Generator argument
122- switch ($systemName ) {
123- " Windows" {
124- switch ($VsVersion ) {
125- 2022 {
126- $cMakeGenerator = " -G `" Visual Studio 17 2022`" -A $architecture "
127- }
128- Default {
129- throw ' This version of Visual Studio is not supported'
130- }
131- }
132- $cMakeCacheVariableOverride += ' -DCMAKE_CONFIGURATION_TYPES=Debug;Release '
133- }
134- " Linux" {
135- $cMakeGenerator = " -G `" Ninja`" "
136-
137- # Set Linux build compiler
138- $env: CC = ' gcc'
139- $env: CXX = ' g++'
140- }
141- " Darwin" {
142- $cMakeGenerator = " -G `" Xcode`" "
143- $cMakeCacheVariableOverride += ' ' + $submoduleCMakeOptions.FRAMEWORK -join ' '
144- }
145- Default {
146- throw ' This system is not supported'
147- }
148- }
149-
122+
150123
151- $cMakeArguments = " -S $repositoryRootPath -B $buildDirectoryPath $cMakeGenerator $cMakeCacheVariableOverride -DCMAKE_BUILD_TYPE=$configuration "
124+ $cMakeArguments = " -S $repositoryRootPath -B $buildDirectoryPath -G $cMakeGenerator $cMakeCacheVariableOverride -DCMAKE_BUILD_TYPE=$configuration "
152125
153126 # CMake Generation process
154127 Write-Host $cMakeArguments
@@ -207,15 +180,15 @@ if(-Not $LauncherOnly) {
207180 }
208181
209182
210- # Run Shader Compilation
211- # foreach ($config in $Configurations) {
212- # $shaderCompileScript = Join-Path $PSScriptRoot -ChildPath "ShaderCompile.ps1"
213- # & pwsh -File $shaderCompileScript -Configuration:$config -ForceRebuild:$true
214- # }
183+ # Run Shader Compilation
184+ foreach ($config in $Configurations ) {
185+ $shaderCompileScript = Join-Path $PSScriptRoot - ChildPath " ShaderCompile.ps1"
186+ & pwsh - File $shaderCompileScript - Configuration:$config - ForceRebuild:$true
187+ }
215188
216- # if ($LASTEXITCODE -ne 0) {
217- # Write-Error "Stopped build process..." -ErrorAction Stop
218- # }
189+ if ($LASTEXITCODE -ne 0 ) {
190+ Write-Error " Stopped build process..." - ErrorAction Stop
191+ }
219192}
220193
221194# Run Engine Build
0 commit comments