Skip to content
Snippets Groups Projects
Commit 48b12c2d authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

rm devtools/deploy/windows/setx64vcvars.ps1

parent be4bd35d
No related branches found
No related tags found
1 merge request!2516CI Win rm redundancies
Pipeline #139848 passed
......@@ -102,8 +102,6 @@ windows:
# paths:
# - build/
script:
# add x64 MSVC variables to the environment
- . ./devtools/deploy/windows/setx64vcvars.ps1
- $OPT_DIR = "C:/opt/x64"
- $BOOST_DIR = "$OPT_DIR/boost_current"
- $QT_MSVC_DIR = "C:/Qt/6.2.4/msvc2019_64"
......@@ -117,6 +115,13 @@ windows:
- echo "# Path '<$Env:Path>'"
- echo "# PythonPath '<$Env:PYTHONPATH>'"
- echo "# Powershell <$PSHOME>`n PS Profile <$PROFILE>`n PS Command-Path <$PSCOMMANDPATH>"
# Visual Studio path <https://github.com/microsoft/vswhere/wiki/Find-VC>
- $vsPath = &"${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationpath
- echo "Microsoft Visual Studio path = '$vsPath'"
- Import-Module (Get-ChildItem $vsPath -Recurse -File -Filter Microsoft.VisualStudio.DevShell.dll).FullName
- Enter-VsDevShell -VsInstallPath $vsPath -SkipAutomaticLocation -DevCmdArguments '-arch=x64'
- Set-Item -Path "env:CC" -Value "cl.exe"
- Set-Item -Path "env:CXX" -Value "cl.exe"
# list all environmental variables
- 'dir Env:'
# make the CMake build directory
......
# Set x64-Related MSVC Variables
# To source this script, first executing scripts must be allowed by changing the execution policy.
# Run PowerShell as an administrator and enter:
# `Set-ExecutionPolicy Bypass`
# See <https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_execution_policies>
# Then, source this script, in _any_ PowerShell session via:
# `. <script-name> [MSVC|Clang]`
# See <https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_scripts?#script-scope-and-dot-sourcing>
param(
[String] $Compiler = "MSVC"
)
if ($Compiler -ne "MSVC" -and $Compiler -ne "Clang") {
Write-Error "Unknown compiler '$Compiler'; must be MSVC or Clang"
Exit -1
}
Write-Host "======================================="
Write-Host "Setting up environment variables..."
# Visual Studio path <https://github.com/microsoft/vswhere/wiki/Find-VC>
$vsPath = &"${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationpath
Write-Host "Microsoft Visual Studio path = '$vsPath'"
# Use module `Microsoft.VisualStudio.DevShell.dll`
Import-Module (Get-ChildItem $vsPath -Recurse -File -Filter Microsoft.VisualStudio.DevShell.dll).FullName
Enter-VsDevShell -VsInstallPath $vsPath -SkipAutomaticLocation -DevCmdArguments '-arch=x64'
# NOTE: `-DevCmdArguments` are arguments to `vsdevcmd.bat`
# Select compiler
if ($Compiler -eq "MSVC") {
$_Compiler = "MSVC"
Set-Item -Path "env:CC" -Value "cl.exe"
Set-Item -Path "env:CXX" -Value "cl.exe"
}
elseif ($Compiler -eq "Clang") {
$_Compiler = "Clang"
Set-Item -Path "env:CC" -Value "clang-cl.exe"
Set-Item -Path "env:CXX" -Value "clang-cl.exe"
}
Write-Host "Selecting $_Compiler as C/C++ compiler."
Write-Host "======================================="
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment