Revert "build system: avoid more unneccesary recompiles"

This was not the correct way to fix the issue.
This commit is contained in:
Björn Linse
2016-02-25 11:36:56 +01:00
parent 5c1597cad1
commit 281a9b2cea

View File

@@ -239,24 +239,23 @@ end
non_static = non_static .. footer non_static = non_static .. footer
static = static .. footer static = static .. footer
local F
F = io.open(static_fname, 'w')
F:write(static)
F:close()
-- Before generating the headers, check if the current file (if exists) is -- Before generating the non-static headers, check if the current file(if
-- different from the new one. If they are the same, we won't touch the -- exists) is different from the new one. If they are the same, we won't touch
-- current version to avoid triggering an unnecessary rebuilds of modules -- the current version to avoid triggering an unnecessary rebuilds of modules
-- that depend on this one -- that depend on this one
local update_changed = function (fname, contents) F = io.open(non_static_fname, 'r')
local F = io.open(fname, 'r') if F ~= nil then
if F ~= nil then if F:read('*a') == non_static then
if F:read('*a') == contents then os.exit(0)
return
end end
io.close(F) io.close(F)
end
F = io.open(fname, 'w')
F:write(contents)
F:close()
end end
update_changed(static_fname, static) F = io.open(non_static_fname, 'w')
update_changed(non_static_fname, non_static) F:write(non_static)
F:close()