1
- param ([switch ] $Generate , [switch ] $Install , [switch ] $InstallOnly , [switch ] $Debug )
1
+ param ([switch ] $Generate , [switch ] $Install , [switch ] $InstallOnly , [switch ] $Debug , [ string ] $UbaEngine )
2
2
3
3
$global :ErrorActionPreference = ' Stop'
4
4
@@ -15,19 +15,31 @@ function Invoke-CmdScript {
15
15
}
16
16
}
17
17
18
- $UbaViaUet = (Test-Path " C:\ProgramData\UET\Current\uet.exe" )
19
-
20
18
Push-Location " $PSScriptRoot \.."
21
19
try {
22
20
# Set the build path.
23
21
$BuildPathDebug = " build\win64\debug"
24
22
$BuildPathRelease = " build\win64\release"
25
- $LauncherFlags = @ ()
26
- $UbaCores = @ ()
27
- if ($UbaViaUet ) {
28
- $LauncherFlags += " -DCMAKE_C_COMPILER_LAUNCHER=$PSScriptRoot \uet-cmake.bat"
29
- $LauncherFlags += " -DCMAKE_CXX_COMPILER_LAUNCHER=$PSScriptRoot \uet-cmake.bat"
30
- $UbaCores += " -j256"
23
+ $CMakeCommand = " C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe"
24
+ $CMakeCommandArguments = @ (
25
+ )
26
+ $CMakeCommandGenerateArguments = @ (
27
+ " -G" ,
28
+ " Ninja"
29
+ )
30
+ if ($null -ne $UbaEngine ) {
31
+ $CMakeCommand = " uet" ;
32
+ if (Test-Path " C:\Work\uet\UET\uet\bin\Debug\net9.0\win-x64\uet.exe" ) {
33
+ $CMakeCommand = " C:\Work\uet\UET\uet\bin\Debug\net9.0\win-x64\uet.exe"
34
+ }
35
+ $CMakeCommandArguments = @ (
36
+ " cmake" ,
37
+ " -e" ,
38
+ $UbaEngine ,
39
+ " --"
40
+ )
41
+ $CMakeCommandGenerateArguments = @ (
42
+ )
31
43
}
32
44
33
45
# Create the session ID for this build.
46
58
if (! (Test-Path $BuildPathRelease )) {
47
59
New-Item - ItemType Directory $BuildPathRelease | Out-Null
48
60
}
49
- # -T host=x64 -A x64 `
50
- & ' C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe' `
51
- - G " Ninja" `
61
+
62
+ & $CMakeCommand $CMakeCommandArguments $CMakeCommandGenerateArguments `
52
63
" -DCMAKE_MAKE_PROGRAM=C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja\ninja.exe" `
53
64
" -DLLVM_ENABLE_PROJECTS:STRING=clang;lld" `
54
65
" -DCMAKE_C_COMPILER=C:\Program Files\LLVM\bin\clang-cl.exe" `
73
84
if ($LastExitCode -ne 0 ) {
74
85
exit $LastExitCode
75
86
}
76
- & ' C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe' `
77
- - G " Ninja" `
87
+ & $CMakeCommand $CMakeCommandArguments $CMakeCommandGenerateArguments `
78
88
" -DCMAKE_MAKE_PROGRAM=C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja\ninja.exe" `
79
89
" -DLLVM_ENABLE_PROJECTS:STRING=clang;lld" `
80
90
" -DCMAKE_C_COMPILER=C:\Program Files\LLVM\bin\clang-cl.exe" `
@@ -111,15 +121,9 @@ try {
111
121
112
122
# Build if not only installing.
113
123
if (! $InstallOnly ) {
114
- # Start UBA worker if needed.
115
- if ($UbaViaUet ) {
116
- Start-Process - NoNewWindow - FilePath " C:\Work\uet\UET\uet\bin\Debug\net8.0\win-x64\uet.exe" - ArgumentList @ (" internal" , " cmake-uba-server" )
117
- }
118
-
119
- & ' C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe' `
124
+ & $CMakeCommand $CMakeCommandArguments `
120
125
-- build $BuildPath `
121
- -- config $BuildConfiguration `
122
- $UbaCores
126
+ -- config $BuildConfiguration
123
127
if ($LastExitCode -ne 0 ) {
124
128
exit $LastExitCode
125
129
}
0 commit comments