Skip to content

Commit

Permalink
Improve PowerShell scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
namazso committed Jun 25, 2023
1 parent ef7776c commit 2b9d2b3
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 12 deletions.
4 changes: 2 additions & 2 deletions build_algorithms.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function Invoke-CmdScript {

$Environment = (Get-ChildItem Env:);

"SSE2", "AVX", "AVX2", "AVX512", "ARM64" | ForEach {
"SSE2", "AVX", "AVX2", "AVX512", "ARM64" | ForEach-Object {
$ExtraFlags = "";
If ($_ -eq "ARM64") {
Invoke-CmdScript "$VSRoot\VC\Auxiliary\Build\vcvarsamd64_arm64.bat"
Expand All @@ -40,5 +40,5 @@ $Environment = (Get-ChildItem Env:);
cmake --install "cmake-algorithms-$_"

Remove-Item -Path Env:*
$Environment | % { Set-Item "env:$($_.Name)" $_.Value }
$Environment | ForEach-Object { Set-Item "env:$($_.Name)" $_.Value }
}
32 changes: 22 additions & 10 deletions build_openhashtab.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@ function Invoke-CmdScript {

$Env:RC = "llvm-rc";

If (Test-Path "Env:CI_VERSION") {
$CI_VERSION = $Env:CI_VERSION;
$CI_VERSION_MAJOR = $Env:CI_VERSION_MAJOR;
$CI_VERSION_MINOR = $Env:CI_VERSION_MINOR;
$CI_VERSION_PATCH = $Env:CI_VERSION_PATCH;
} Else {
$CI_VERSION = "(unknown)";
$CI_VERSION_MAJOR = 0;
$CI_VERSION_MINOR = 0;
$CI_VERSION_PATCH = 0;
}

$Environment = (Get-ChildItem Env:);

Invoke-CmdScript "$VSRoot\VC\Auxiliary\Build\vcvars64.bat"
Expand All @@ -26,14 +38,14 @@ cmake `
-DCMAKE_BUILD_TYPE=RelWithDebInfo `
-DCMAKE_C_COMPILER=clang-cl `
-DCMAKE_CXX_COMPILER=clang-cl `
"-DCI_VERSION=$Env:CI_VERSION" `
"-DCI_VERSION_MINOR=$Env:CI_VERSION_MINOR" `
"-DCI_VERSION_MAJOR=$Env:CI_VERSION_MAJOR" `
"-DCI_VERSION_PATCH=$Env:CI_VERSION_PATCH"
"-DCI_VERSION=$CI_VERSION" `
"-DCI_VERSION_MINOR=$CI_VERSION_MINOR" `
"-DCI_VERSION_MAJOR=$CI_VERSION_MAJOR" `
"-DCI_VERSION_PATCH=$CI_VERSION_PATCH"
cmake --build "cmake-openhashtab-x64"

Remove-Item -Path Env:*
$Environment | % { Set-Item "env:$($_.Name)" $_.Value }
$Environment | ForEach-Object { Set-Item "env:$($_.Name)" $_.Value }

Invoke-CmdScript "$VSRoot\VC\Auxiliary\Build\vcvarsamd64_arm64.bat"
$ExtraFlags = "--target=arm64-pc-windows-msvc";
Expand All @@ -48,11 +60,11 @@ cmake `
-DCMAKE_BUILD_TYPE=RelWithDebInfo `
-DCMAKE_C_COMPILER=clang-cl `
-DCMAKE_CXX_COMPILER=clang-cl `
"-DCI_VERSION=$Env:CI_VERSION" `
"-DCI_VERSION_MINOR=$Env:CI_VERSION_MINOR" `
"-DCI_VERSION_MAJOR=$Env:CI_VERSION_MAJOR" `
"-DCI_VERSION_PATCH=$Env:CI_VERSION_PATCH"
"-DCI_VERSION=$CI_VERSION" `
"-DCI_VERSION_MINOR=$CI_VERSION_MINOR" `
"-DCI_VERSION_MAJOR=$CI_VERSION_MAJOR" `
"-DCI_VERSION_PATCH=$CI_VERSION_PATCH"
cmake --build "cmake-openhashtab-ARM64"

Remove-Item -Path Env:*
$Environment | % { Set-Item "env:$($_.Name)" $_.Value }
$Environment | ForEach-Object { Set-Item "env:$($_.Name)" $_.Value }

0 comments on commit 2b9d2b3

Please sign in to comment.