mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Merge pull request #4216 from bfredl/rebuild
build system: avoid more unneccesary recompiles
This commit is contained in:
commit
75f6817a51
@ -239,23 +239,24 @@ 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 non-static headers, check if the current file(if
|
-- Before generating the headers, check if the current file (if exists) is
|
||||||
-- exists) is different from the new one. If they are the same, we won't touch
|
-- different from the new one. If they are the same, we won't touch the
|
||||||
-- the current version to avoid triggering an unnecessary rebuilds of modules
|
-- current version to avoid triggering an unnecessary rebuilds of modules
|
||||||
-- that depend on this one
|
-- that depend on this one
|
||||||
F = io.open(non_static_fname, 'r')
|
local update_changed = function (fname, contents)
|
||||||
if F ~= nil then
|
local F = io.open(fname, 'r')
|
||||||
if F:read('*a') == non_static then
|
if F ~= nil then
|
||||||
os.exit(0)
|
if F:read('*a') == contents then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
io.close(F)
|
||||||
end
|
end
|
||||||
io.close(F)
|
|
||||||
|
F = io.open(fname, 'w')
|
||||||
|
F:write(contents)
|
||||||
|
F:close()
|
||||||
end
|
end
|
||||||
|
|
||||||
F = io.open(non_static_fname, 'w')
|
update_changed(static_fname, static)
|
||||||
F:write(non_static)
|
update_changed(non_static_fname, non_static)
|
||||||
F:close()
|
|
||||||
|
Loading…
Reference in New Issue
Block a user