forked from Mudlet/Mudlet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup-windows-sdk.ps1
44 lines (36 loc) · 1.35 KB
/
setup-windows-sdk.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
$sourceDir = $pwd.Path
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Unrestricted
If (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator"))
{
$arguments = ("-ExecutionPolicy", "Bypass", "cd `"$sourceDir\CI`" ; & '.\appveyor.install.ps1'")
Start-Process powershell -Verb runAs -ArgumentList $arguments -Wait
}
else {
cd CI
.\appveyor.install.ps1
}
cd "$sourceDir"
. CI\appveyor.functions.ps1
SetQtBaseDir "C:\src\verbose_output.log"
SetMingwBaseDir "C:\src\verbose_output.log"
SetLuarocksPath "C:\src\verbose_output.log"
if(-NOT (Test-Path "$sourceDir\build")){
New-Item -ItemType Directory "$sourceDir\build"
}
cd "$sourceDir\build"
Write-Output "Running qmake"
$Env:PATH="C:\Program Files (x86)\CMake\bin;C:\Program Files\7-Zip;C:\Program Files\ccache;$Env:QT_BASE_DIR\bin;$Env:MINGW_BASE_DIR\bin;" + (($Env:PATH.Split(';') | Where-Object { $_ -ne 'C:\Program Files\Git\usr\bin' }) -join ';')
qmake CONFIG+=debug ../src/mudlet.pro
if("$LastExitCode" -ne "0"){
Read-Host
exit 1
}
Write-Output "Running make"
mingw32-make -j $(Get-WmiObject win32_processor | Select -ExpandProperty "NumberOfLogicalProcessors")
if("$LastExitCode" -ne "0"){
Read-Host
exit 1
}
cd "$sourceDir\build"
Start-Process -wait debug\mudlet.exe
cd $sourceDir