forked from grayver/mi-vigem
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed undefined behaviour, reworked build process.
- Loading branch information
Connor Walker
committed
Jan 10, 2022
1 parent
5bcb5b4
commit 8e2a96f
Showing
9 changed files
with
155 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[submodule "ViGEmClient"] | ||
path = ViGEmClient | ||
url = https://github.com/Ryochan7/ViGEmClient.git | ||
url = https://github.com/ViGEm/ViGEmClient.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
[CmdletBinding()] | ||
param ( | ||
[Parameter()][ValidateSet("DEBUG", "RELEASE")][string]$Configuration = "DEBUG", | ||
[Parameter()][ValidateSet("x86", "x64")][string]$Architecture = "x86" | ||
) | ||
|
||
$script:CommonFlags = @("/Zi", "/W4", "/EHsc", "/DWIN32", "/D_UNICODE", "/DUNICODE") | ||
$script:DebugFlags = @( "/Od" ) | ||
$script:ReleaseFlags = @("/GL", "/O2") | ||
|
||
$script:OutputName = "stadia-vigem-" | ||
|
||
function Import-Prerequisites { | ||
if (Get-Module -ListAvailable -Name WintellectPowerShell) { | ||
Update-Module -Name WintellectPowerShell | ||
} else { | ||
Install-Module -Name WintellectPowerShell -Scope CurrentUser -Force | ||
} | ||
|
||
Import-Module -Name WintellectPowerShell | ||
} | ||
|
||
function Invoke-BuildTools { | ||
param ( | ||
$Architecture | ||
) | ||
|
||
$latestVsInstallationInfo = Get-VSSetupInstance -All | Sort-Object -Property InstallationVersion -Descending | Select-Object -First 1 | ||
|
||
Invoke-CmdScript "$($latestVsInstallationInfo.InstallationPath)\VC\Auxiliary\Build\vcvarsall.bat" $Architecture | ||
} | ||
|
||
function Invoke-Build { | ||
param ( | ||
$Architecture | ||
) | ||
|
||
$OutputName = "$script:OutputName$Architecture.exe" | ||
$Flags = If ($Configuration -eq "DEBUG") {$script:DebugFlags} else {$script:ReleaseFlags} | ||
|
||
$StopWatch = New-Object -TypeName System.Diagnostics.Stopwatch | ||
|
||
Write-Host "*** ${OutputName}: Build started ***" | ||
Write-Host | ||
|
||
$StopWatch.Start() | ||
|
||
& "rc.exe" /foobj/stadia-vigem.res res/res.rc | ||
& "cl.exe" $Flags $CommonFlags /IViGEmClient/include /Foobj/ /Febin/$OutputName ViGEmClient/src/*.cpp obj/stadia-vigem.res src/*.c | ||
|
||
$StopWatch.Stop() | ||
|
||
Write-Host | ||
Write-Host "*** ${OutputName}: Build finished in $($StopWatch.Elapsed) ***" | ||
} | ||
|
||
# Entry | ||
|
||
New-Item -Path "bin" -ItemType Directory -Force > $null | ||
New-Item -Path "obj" -ItemType Directory -Force > $null | ||
|
||
Import-Prerequisites | ||
|
||
Write-Host "-- Build started. Configuration: $Configuration, Architecture: $Architecture --" | ||
|
||
if ($Architecture -eq "x86" -Or $Architecture -eq "ALL") { | ||
Invoke-BuildTools -Architecture "x86" | ||
Invoke-Build -Architecture "x86" | ||
} | ||
|
||
if ($Architecture -eq "x64" -Or $Architecture -eq "ALL") { | ||
Invoke-BuildTools -Architecture "x64" | ||
Invoke-Build -Architecture "x64" | ||
} | ||
|
||
Write-Host "-- Build completed. --" |
Submodule ViGEmClient
updated
from 843b1c to e86924
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters