Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pass platform argument only if vccexe is used #13078

Merged
merged 3 commits into from
Jan 14, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions compiler/extccomp.nim
Original file line number Diff line number Diff line change
Expand Up @@ -558,15 +558,14 @@ proc getCompileOptions(conf: ConfigRef): string =
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 = ""
if conf.cCompiler == ccVcc:
let exe = getConfigVar(conf, conf.cCompiler, ".exe")
if "vccexe.exe" == extractFilename(exe):
result = case conf.target.targetCPU
of cpuI386: " --platform:x86"
of cpuArm: " --platform:arm"
of cpuAmd64: " --platform:amd64"
else: ""

proc getLinkOptions(conf: ConfigRef): string =
result = conf.linkOptions & " " & conf.linkOptionsCmd & " "
Expand Down Expand Up @@ -596,7 +595,7 @@ proc getLinkerExe(conf: ConfigRef; compiler: TSystemCC): string =

proc getCompileCFileCmd*(conf: ConfigRef; cfile: Cfile,
isMainFile = false; produceOutput = false): string =
var c = conf.cCompiler
let c = conf.cCompiler
# We produce files like module.nim.cpp, so the absolute Nim filename is not
# cfile.name but `cfile.cname.changeFileExt("")`:
var options = cFileSpecificOptions(conf, cfile.nimname, cfile.cname.changeFileExt("").string)
Expand Down