make the vccexe helper tool compile again

This commit is contained in:
Araq 2018-08-13 15:42:20 +02:00
commit 46204eba1f
2 changed files with 7 additions and 7 deletions

View file

@ -19,7 +19,7 @@ proc getVsComnToolsPath*(): TaintedString =
return vsComnToolsEnvVal return vsComnToolsEnvVal
proc getVccEnv*(platform: string, windowsStoreSdk: bool = false, proc getVccEnv*(platform: string, windowsStoreSdk: bool = false,
sdkVersion: string = nil): StringTableRef = sdkVersion: string = ""): StringTableRef =
var comSpecCommandString = getEnv comSpecEnvKey var comSpecCommandString = getEnv comSpecEnvKey
if comSpecCommandString.len == 0: if comSpecCommandString.len == 0:
comSpecCommandString = "cmd" comSpecCommandString = "cmd"

View file

@ -5,14 +5,14 @@ when defined(release):
else: else:
let vccOptions = {poEchoCmd, poParentStreams} let vccOptions = {poEchoCmd, poParentStreams}
const const
platformPrefix = "--platform" platformPrefix = "--platform"
winstorePrefix = "--winstore" winstorePrefix = "--winstore"
sdkversionPrefix = "--sdkversion" sdkversionPrefix = "--sdkversion"
platformSepIdx = platformPrefix.len platformSepIdx = platformPrefix.len
sdkversionSepIdx = sdkversionPrefix.len sdkversionSepIdx = sdkversionPrefix.len
HelpText = """ HelpText = """
+-----------------------------------------------------------------+ +-----------------------------------------------------------------+
| Microsoft C/C++ compiler wrapper for Nim | | Microsoft C/C++ compiler wrapper for Nim |
@ -26,7 +26,7 @@ Options:
<arch>: x86 | amd64 | arm | x86_amd64 | x86_arm | amd64_x86 | amd64_arm <arch>: x86 | amd64 | arm | x86_amd64 | x86_arm | amd64_x86 | amd64_arm
--winstore Use Windows Store (rather than desktop) development tools --winstore Use Windows Store (rather than desktop) development tools
--sdkversion:<v> Use a specific Windows SDK version: --sdkversion:<v> Use a specific Windows SDK version:
<v> is either the full Windows 10 SDK version number or <v> is either the full Windows 10 SDK version number or
"8.1" to use the windows 8.1 SDK "8.1" to use the windows 8.1 SDK
Other command line arguments are passed on to the Other command line arguments are passed on to the
@ -34,8 +34,8 @@ Microsoft C/C++ compiler for the specified SDK toolset
""" """
when isMainModule: when isMainModule:
var platformArg: string = nil var platformArg: string = ""
var sdkVersionArg: string = nil var sdkVersionArg: string = ""
var storeArg: bool = false var storeArg: bool = false
var clArgs: seq[TaintedString] = @[] var clArgs: seq[TaintedString] = @[]
@ -54,7 +54,7 @@ when isMainModule:
echo HelpText echo HelpText
clArgs.add(wargv) clArgs.add(wargv)
var vccEnvStrTab = getVccEnv(platformArg, storeArg, sdkVersionArg) var vccEnvStrTab = getVccEnv(platformArg, storeArg, sdkVersionArg)
if vccEnvStrTab != nil: if vccEnvStrTab != nil:
for vccEnvKey, vccEnvVal in vccEnvStrTab: for vccEnvKey, vccEnvVal in vccEnvStrTab:
putEnv(vccEnvKey, vccEnvVal) putEnv(vccEnvKey, vccEnvVal)