When compiling from stdin write binary to stdinfile
This commit is contained in:
parent
6894ac7c0a
commit
c37e8035ea
3 changed files with 4 additions and 2 deletions
|
|
@ -62,7 +62,7 @@ proc commandCompileToC =
|
||||||
compileProject()
|
compileProject()
|
||||||
cgenWriteModules()
|
cgenWriteModules()
|
||||||
if gCmd != cmdRun:
|
if gCmd != cmdRun:
|
||||||
extccomp.callCCompiler(changeFileExt(gProjectFull, ""))
|
extccomp.callCCompiler(if gProjectName == "-": "stdinfile" else: changeFileExt(gProjectFull, ""))
|
||||||
|
|
||||||
if isServing:
|
if isServing:
|
||||||
# caas will keep track only of the compilation commands
|
# caas will keep track only of the compilation commands
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,8 @@ proc handleCmdLine() =
|
||||||
if gCmd == cmdRun:
|
if gCmd == cmdRun:
|
||||||
tccgen.run(commands.arguments)
|
tccgen.run(commands.arguments)
|
||||||
if optRun in gGlobalOptions:
|
if optRun in gGlobalOptions:
|
||||||
|
if gProjectName == "-":
|
||||||
|
gProjectFull = "stdinfile"
|
||||||
if gCmd == cmdCompileToJS:
|
if gCmd == cmdCompileToJS:
|
||||||
var ex: string
|
var ex: string
|
||||||
if options.outFile.len > 0:
|
if options.outFile.len > 0:
|
||||||
|
|
|
||||||
|
|
@ -171,7 +171,7 @@ proc processModule(module: PSym, stream: PLLStream, rd: PRodReader) =
|
||||||
if stream == nil:
|
if stream == nil:
|
||||||
let filename = fileIdx.toFullPathConsiderDirty
|
let filename = fileIdx.toFullPathConsiderDirty
|
||||||
if module.name.s == "-":
|
if module.name.s == "-":
|
||||||
module.name.s = "stdinFile"
|
module.name.s = "stdinfile"
|
||||||
s = llStreamOpen(stdin)
|
s = llStreamOpen(stdin)
|
||||||
else:
|
else:
|
||||||
s = llStreamOpen(filename, fmRead)
|
s = llStreamOpen(filename, fmRead)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue