From 48b12c2d572364c182ac712fdf27299a4da9a7eb Mon Sep 17 00:00:00 2001
From: "Joachim Wuttke (h)" <j.wuttke@fz-juelich.de>
Date: Wed, 24 Apr 2024 07:05:45 +0200
Subject: [PATCH] rm devtools/deploy/windows/setx64vcvars.ps1

---
 .gitlab-ci.yml                           |  9 ++++-
 devtools/deploy/windows/setx64vcvars.ps1 | 48 ------------------------
 2 files changed, 7 insertions(+), 50 deletions(-)
 delete mode 100644 devtools/deploy/windows/setx64vcvars.ps1

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 8d26ff000a1..571b9117c2a 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -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
diff --git a/devtools/deploy/windows/setx64vcvars.ps1 b/devtools/deploy/windows/setx64vcvars.ps1
deleted file mode 100644
index 7b2a6e72c7f..00000000000
--- a/devtools/deploy/windows/setx64vcvars.ps1
+++ /dev/null
@@ -1,48 +0,0 @@
-# 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 "======================================="
-- 
GitLab