From 138edbbd1ccca0e002775cced48a14733c98e484 Mon Sep 17 00:00:00 2001 From: ruki Date: Tue, 4 Jun 2019 00:52:06 +0800 Subject: improve to load dep file --- xmake/modules/core/project/depend.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'xmake/modules/core/project/depend.lua') diff --git a/xmake/modules/core/project/depend.lua b/xmake/modules/core/project/depend.lua index 4a4f7636b..15189a204 100644 --- a/xmake/modules/core/project/depend.lua +++ b/xmake/modules/core/project/depend.lua @@ -20,7 +20,10 @@ -- load dependent info from the given file (.d) function load(dependfile) - return os.isfile(dependfile) and io.load(dependfile) or nil + if os.isfile(dependfile) then + -- may be the depend file has been incomplete when if the compilation process is abnormally interrupted + return try { function() return io.load(dependfile) end } + end end -- save dependent info to file -- cgit v1.3.1