From 1a50442c13bfc19fe314df0a0fec87dd1b3c5d48 Mon Sep 17 00:00:00 2001 From: Paul Tan Date: Fri, 18 Aug 2017 20:42:16 +0800 Subject: [PATCH] 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. --- compiler/main.nim | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/main.nim b/compiler/main.nim index f662ded1ba..76e18a80b0 100644 --- a/compiler/main.nim +++ b/compiler/main.nim @@ -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)