Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

win build works #2

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions winbuild/BuildAll.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
> .\BuildAll Clean
Clean all generated files.
.EXAMPLE
> .\BuildAll -V(CVersion) 11.0
Build using Visual Studio 11.0 environment.
> .\BuildAll -V(CVersion) 12.0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I don't see much a point in supporting 11.0 at this stage. The newest version available is more than enough.

Build using Visual Studio 12.0 environment.
.EXAMPLE
> .\BuildAll -P(latform) x64
Build only 64bit dlls.
Expand Down
11 changes: 9 additions & 2 deletions winbuild/MSProgram-Get.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ function Find-MSBuild
if ("$VisualStudioVersion" -eq "") {
if ((Find-VSDir 15) -ne "") { # VC15 is installed (current official)
$VisualStudioVersion = "15.0"
} elseif ((Find-VSDir 17) -ne "") { # VC17 is installed
$VisualStudioVersion = "17.0"
} elseif ((Find-VSDir 16) -ne "") { # VC16 is installed
$VisualStudioVersion = "16.0"
} elseif ("${env:VS140COMNTOOLS}" -ne "") { # VC14 is installed
Expand All @@ -67,6 +69,7 @@ function Find-MSBuild
"14.0" { $toolsout = 14 }
"15.0" { $toolsout = 15 }
"16.0" { $toolsout = 16 }
"17.0" { $toolsout = 17 }
default { throw "Selected Visual Stuidio is Version ${VisualStudioVersion}. Please use VC10 or later"}
}
#
Expand Down Expand Up @@ -149,6 +152,7 @@ function Find-MSBuild
"14.0" {$Toolsetv="v140_xp"}
"15.0" {$Toolsetv="v141_xp"}
"16.0" {$Toolsetv="v142"}
"17.0" {$Toolsetv="v143"}
}
}
# avoid a bug of Windows7.1SDK PlatformToolset
Expand Down Expand Up @@ -400,7 +404,7 @@ function find_vs_installation
return $vsdir
}

$vsarray = @{VC15 = "2017"; VC16 = "2019"}
$vsarray = @{VC15 = "2017"; VC16 = "2019"; VC17 = "2022";}
# find VS dir for VC15 ~ VC16
function find_default_msbuild_path
{
Expand All @@ -413,12 +417,15 @@ function find_default_msbuild_path
if ($vsdir -eq "")
{
$toolsnum = [int]$toolsver
if ($env:PROCESSOR_ARCHITECTURE -eq "x86") {
Write-Debug "Processor $env:PROCESSOR_ARCHITECTURE"
if ($env:PROCESSOR_ARCHITECTURE -eq "x86" -or $env:PROCESSOR_ARCHITECTURE -eq "ARM64") {
$pgmfs = "$env:ProgramFiles"
} else {
$pgmfs = "${env:ProgramFiles(x86)}"
}
$vsverdir = $vsarray["VC$toolsnum"]
Write-Debug "VS Version $vsverdir"
Write-Debug "$pgmfs\Microsoft Visual Studio\$vsverdir\*\MSBuild\*\Bin\"
$lslist = @(Get-ChildItem "$pgmfs\Microsoft Visual Studio\$vsverdir\*\MSBuild\*\Bin\MSBuild.exe" -ErrorAction SilentlyContinue)
} else {
$lslist = @(Get-ChildItem "$vsdir\MSBuild\*\Bin\MSBuild.exe" -ErrorAction SilentlyContinue)
Expand Down
8 changes: 8 additions & 0 deletions winbuild/setenv.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
pushd "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\"
cmd /c "vcvarsarm64.bat&set" |
foreach {
if ($_ -match "=") {
$v = $_.split("="); set-item -force -path "ENV:\$($v[0])" -value "$($v[1])"
}
}
popd