Generate deps file during C compilation

The "genDepend" command was previously taught how to generate a "deps"
file in 4910a87c6 (gendepend improvements; refs #5144). Such a deps file
is useful in integrating the Nim compiler with an external build system
or watch daemon, such that it's possible to only run the Nim compiler
when any of the source files are modified.

It's also useful to generate the deps file in the nimcache directory
during C compilation, without needing to re-run the compilation passes
with "genDepend". This would thus reduce overall project build times.
This commit is contained in:
Paul Tan
2017-08-18 20:42:16 +08:00
parent 496716ee9b
commit 1a50442c13

View File

@@ -77,6 +77,7 @@ proc commandCompileToC(graph: ModuleGraph; cache: IdentCache) =
let proj = changeFileExt(gProjectFull, "")
extccomp.callCCompiler(proj)
extccomp.writeJsonBuildInstructions(proj)
writeDepsFile(graph, toGeneratedFile(proj, ""))
proc commandCompileToJS(graph: ModuleGraph; cache: IdentCache) =
#incl(gGlobalOptions, optSafeCode)