fixes #11306
This commit is contained in:
parent
1a8ef6b491
commit
d67a9f024e
2 changed files with 20 additions and 19 deletions
|
|
@ -138,12 +138,12 @@ compiler vcc:
|
||||||
optSize: " /O1 /G7 ",
|
optSize: " /O1 /G7 ",
|
||||||
compilerExe: "cl",
|
compilerExe: "cl",
|
||||||
cppCompiler: "cl",
|
cppCompiler: "cl",
|
||||||
compileTmpl: "/c $options $include /Fo$objfile $file",
|
compileTmpl: "/c$vccplatform$options $include /Fo$objfile $file",
|
||||||
buildGui: " /link /SUBSYSTEM:WINDOWS ",
|
buildGui: " /link /SUBSYSTEM:WINDOWS ",
|
||||||
buildDll: " /LD",
|
buildDll: " /LD",
|
||||||
buildLib: "lib /OUT:$libfile $objfiles",
|
buildLib: "lib /OUT:$libfile $objfiles",
|
||||||
linkerExe: "cl",
|
linkerExe: "cl",
|
||||||
linkTmpl: "$options $builddll /Fe$exefile $objfiles $buildgui",
|
linkTmpl: "$options $builddll$vccplatform /Fe$exefile $objfiles $buildgui",
|
||||||
includeCmd: " /I",
|
includeCmd: " /I",
|
||||||
linkDirCmd: " /LIBPATH:",
|
linkDirCmd: " /LIBPATH:",
|
||||||
linkLibCmd: " $1.lib",
|
linkLibCmd: " $1.lib",
|
||||||
|
|
@ -528,6 +528,19 @@ proc cFileSpecificOptions(conf: ConfigRef; nimname: string): string =
|
||||||
proc getCompileOptions(conf: ConfigRef): string =
|
proc getCompileOptions(conf: ConfigRef): string =
|
||||||
result = cFileSpecificOptions(conf, "__dummy__")
|
result = cFileSpecificOptions(conf, "__dummy__")
|
||||||
|
|
||||||
|
proc vccplatform(conf: ConfigRef): string =
|
||||||
|
# VCC specific but preferable over the config hacks people
|
||||||
|
# had to do before, see #11306
|
||||||
|
case conf.target.targetCPU
|
||||||
|
of cpuI386:
|
||||||
|
result = " --platform:x86"
|
||||||
|
of cpuArm:
|
||||||
|
result = " --platform:arm"
|
||||||
|
of cpuAmd64:
|
||||||
|
result = " --platform:amd64"
|
||||||
|
else:
|
||||||
|
result = ""
|
||||||
|
|
||||||
proc getLinkOptions(conf: ConfigRef): string =
|
proc getLinkOptions(conf: ConfigRef): string =
|
||||||
result = conf.linkOptions & " " & conf.linkOptionsCmd & " "
|
result = conf.linkOptions & " " & conf.linkOptionsCmd & " "
|
||||||
for linkedLib in items(conf.cLinkedLibs):
|
for linkedLib in items(conf.cLinkedLibs):
|
||||||
|
|
@ -611,7 +624,8 @@ proc getCompileCFileCmd*(conf: ConfigRef; cfile: Cfile, isMainFile = false): str
|
||||||
"file", cfsh, "objfile", objfile,
|
"file", cfsh, "objfile", objfile,
|
||||||
"options", options, "include", includeCmd,
|
"options", options, "include", includeCmd,
|
||||||
"nim", quoteShell(getPrefixDir(conf)),
|
"nim", quoteShell(getPrefixDir(conf)),
|
||||||
"lib", quoteShell(conf.libpath)])
|
"lib", quoteShell(conf.libpath),
|
||||||
|
"vccplatform", vccplatform(conf)])
|
||||||
|
|
||||||
proc footprint(conf: ConfigRef; cfile: Cfile): SecureHash =
|
proc footprint(conf: ConfigRef; cfile: Cfile): SecureHash =
|
||||||
result = secureHash(
|
result = secureHash(
|
||||||
|
|
@ -716,7 +730,8 @@ proc getLinkCmd(conf: ConfigRef; output: AbsoluteFile,
|
||||||
"buildgui", buildgui, "options", linkOptions,
|
"buildgui", buildgui, "options", linkOptions,
|
||||||
"objfiles", objfiles, "exefile", exefile,
|
"objfiles", objfiles, "exefile", exefile,
|
||||||
"nim", quoteShell(getPrefixDir(conf)),
|
"nim", quoteShell(getPrefixDir(conf)),
|
||||||
"lib", quoteShell(conf.libpath)])
|
"lib", quoteShell(conf.libpath),
|
||||||
|
"vccplatform", vccplatform(conf)])
|
||||||
# On windows the debug information for binaries is emitted in a separate .pdb
|
# On windows the debug information for binaries is emitted in a separate .pdb
|
||||||
# file and the binaries (.dll and .exe) contain a full path to that .pdb file.
|
# file and the binaries (.dll and .exe) contain a full path to that .pdb file.
|
||||||
# This is a problem for hot code reloading because even when we copy the .dll
|
# This is a problem for hot code reloading because even when we copy the .dll
|
||||||
|
|
|
||||||
|
|
@ -246,20 +246,6 @@ vcc.cpp.exe = "vccexe.exe"
|
||||||
vcc.linkerexe = "vccexe.exe"
|
vcc.linkerexe = "vccexe.exe"
|
||||||
vcc.cpp.linkerexe = "vccexe.exe"
|
vcc.cpp.linkerexe = "vccexe.exe"
|
||||||
|
|
||||||
# set the options for cross compiles. (hostCPU != targetCPU)
|
|
||||||
i386.windows.vcc.options.always = "/nologo --platform:x86"
|
|
||||||
amd64.windows.vcc.options.always = "/nologo --platform:amd64"
|
|
||||||
arm.windows.vcc.options.always = "/nologo --platform:arm"
|
|
||||||
|
|
||||||
# set the options for specific platforms:
|
|
||||||
@if i386:
|
|
||||||
vcc.options.always %= "${i386.windows.vcc.options.always}"
|
|
||||||
@elif amd64:
|
|
||||||
vcc.options.always %= "${amd64.windows.vcc.options.always}"
|
|
||||||
@elif arm:
|
|
||||||
vcc.options.always %= "${arm.windows.vcc.options.always}"
|
|
||||||
@end
|
|
||||||
|
|
||||||
vcc.cpp.options.always = "/EHsc"
|
vcc.cpp.options.always = "/EHsc"
|
||||||
vcc.options.linker.always = "/F33554432" # set the stack size to 32 MiB
|
vcc.options.linker.always = "/F33554432" # set the stack size to 32 MiB
|
||||||
vcc.options.debug = "/Zi /FS /Od"
|
vcc.options.debug = "/Zi /FS /Od"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue