summary refs log tree commit diff stats
path: root/tools/vccexe/vcvarsall.nim
diff options
context:
space:
mode:
authorJuan M Gómez <info@jmgomez.me>2023-02-09 21:19:05 +0000
committerGitHub <noreply@github.com>2023-02-09 16:19:05 -0500
commit642136ec4f2cd93cdd753bf16fa4aec89b8fee82 (patch)
tree38650925594a11708aa5930113beb36a7f96f4bb /tools/vccexe/vcvarsall.nim
parent51f410e1d5c19e42e97057f0b88e87056b7c43e2 (diff)
downloadNim-642136ec4f2cd93cdd753bf16fa4aec89b8fee82.tar.gz
Adds an extra optional argument to vcc: `vctoolset` Fixes #21335 (#21336)
Diffstat (limited to 'tools/vccexe/vcvarsall.nim')
-rw-r--r--tools/vccexe/vcvarsall.nim7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/vccexe/vcvarsall.nim b/tools/vccexe/vcvarsall.nim
index 29d13cc7e..73b103e3c 100644
--- a/tools/vccexe/vcvarsall.nim
+++ b/tools/vccexe/vcvarsall.nim
@@ -33,7 +33,7 @@ type
     vccplatUWP = "uwp", ## Universal Windows Platform (UWP) Application
     vccplatOneCore = "onecore" # Undocumented platform type in the Windows SDK, probably XBox One SDK platform type.
 
-proc vccVarsAll*(path: string, arch: VccArch = vccarchUnspecified, platform_type: VccPlatformType = vccplatEmpty, sdk_version: string = "", verbose: bool = false): StringTableRef =
+proc vccVarsAll*(path: string, arch: VccArch = vccarchUnspecified, platform_type: VccPlatformType = vccplatEmpty, sdk_version, vctoolset: string = "", verbose: bool = false): StringTableRef =
   ## Returns a string table containing the proper process environment to successfully execute VCC compile commands for the specified SDK version, CPU architecture and platform type.
   ##
   ## path
@@ -44,6 +44,8 @@ proc vccVarsAll*(path: string, arch: VccArch = vccarchUnspecified, platform_type
   ##   The compile target Platform Type. Defaults to the Windows Desktop platform, i.e. a regular Windows executable binary.
   ## sdk_version
   ##   The Windows SDK version to use.
+  ## vctoolset
+  ##  Visual Studio compiler toolset to use.
   ## verbose
   ##   Echo the command-line passed on to the system to load the VCC environment. Defaults to `false`.
 
@@ -63,6 +65,9 @@ proc vccVarsAll*(path: string, arch: VccArch = vccarchUnspecified, platform_type
 
   if sdk_version.len > 0:
     args.add(sdk_version)
+  
+  if vctoolset.len > 0:
+    args.add("-vcvars_ver="&vctoolset)
 
   let argStr = args.join " "