@@ -558,15 +558,14 @@ proc getCompileOptions(conf: ConfigRef): string =
558558proc vccplatform (conf: ConfigRef ): string =
559559 # VCC specific but preferable over the config hacks people
560560 # had to do before, see #11306
561- case conf.target.targetCPU
562- of cpuI386:
563- result = " --platform:x86"
564- of cpuArm:
565- result = " --platform:arm"
566- of cpuAmd64:
567- result = " --platform:amd64"
568- else :
569- result = " "
561+ if conf.cCompiler == ccVcc:
562+ let exe = getConfigVar (conf, conf.cCompiler, " .exe" )
563+ if " vccexe.exe" == extractFilename (exe):
564+ result = case conf.target.targetCPU
565+ of cpuI386: " --platform:x86"
566+ of cpuArm: " --platform:arm"
567+ of cpuAmd64: " --platform:amd64"
568+ else : " "
570569
571570proc getLinkOptions (conf: ConfigRef ): string =
572571 result = conf.linkOptions & " " & conf.linkOptionsCmd & " "
@@ -596,7 +595,7 @@ proc getLinkerExe(conf: ConfigRef; compiler: TSystemCC): string =
596595
597596proc getCompileCFileCmd * (conf: ConfigRef ; cfile: Cfile ,
598597 isMainFile = false ; produceOutput = false ): string =
599- var c = conf.cCompiler
598+ let c = conf.cCompiler
600599 # We produce files like module.nim.cpp, so the absolute Nim filename is not
601600 # cfile.name but `cfile.cname.changeFileExt("")`:
602601 var options = cFileSpecificOptions (conf, cfile.nimname, cfile.cname.changeFileExt (" " ).string )
0 commit comments