From 4b787fb7d1af5a0f764e9a75f36eaa34c64fe237 Mon Sep 17 00:00:00 2001 From: Thiago de Arruda Date: Mon, 2 Jun 2014 15:32:50 -0300 Subject: Make gendeclarations.lua more friendly to incremental builds Modify gendeclarations.lua to check if the generated non-static declaration header changed before rewriting it with a new version. This is to prevent unnecessary rebuilds of modules that depend on modules that had private changes. --- scripts/gendeclarations.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/scripts/gendeclarations.lua b/scripts/gendeclarations.lua index 311ed8b527..76711cc214 100755 --- a/scripts/gendeclarations.lua +++ b/scripts/gendeclarations.lua @@ -227,6 +227,18 @@ F = io.open(static_fname, 'w') F:write(static) F:close() +-- Before generating the non-static headers, check if the current file(if +-- exists) is different from the new one. If they are the same, we won't touch +-- the current version to avoid triggering an unnecessary rebuilds of modules +-- that depend on this one +F = io.open(non_static_fname, 'r') +if F ~= nil then + if F:read('*a') == non_static then + os.exit(0) + end + io.close(F) +end + F = io.open(non_static_fname, 'w') F:write(non_static) F:close() -- cgit