diff options
| author | ruki <[email protected]> | 2017-07-31 09:16:31 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2017-07-31 09:16:31 +0800 |
| commit | fa9702bfcf4ba7ed2b599727913444cc3498bfda (patch) | |
| tree | 444daea100eefb93a662529ebbc01e20d7e0ba50 | |
| parent | 94f00ffc6d2e70316b8200f33ba6caeffce8674a (diff) | |
fix rebuild source file when compiling fails
| -rw-r--r-- | docs/zh/manual.md | 2 | ||||
| -rw-r--r-- | xmake/modules/core/tools/cl.lua | 3 | ||||
| -rw-r--r-- | xmake/modules/core/tools/gcc.lua | 5 |
3 files changed, 8 insertions, 2 deletions
diff --git a/docs/zh/manual.md b/docs/zh/manual.md index a65875c0e..1271e09ce 100644 --- a/docs/zh/manual.md +++ b/docs/zh/manual.md @@ -6497,7 +6497,7 @@ local ok = has_cfuncs({"sigsetjmp((void*)0, 0)", "setjmp"}, {includes = "setjmp. - 判断指定c头文件是否存在 -此接口是[lib.detect.check_cxsnippets](#detect-check_cxsnippets)的简化版本,仅用于检测函数。 +此接口是[lib.detect.check_cxsnippets](#detect-check_cxsnippets)的简化版本,仅用于检测头文件。 ```lua import("lib.detect.has_cincludes") diff --git a/xmake/modules/core/tools/cl.lua b/xmake/modules/core/tools/cl.lua index 636bac50c..e9a3682bf 100644 --- a/xmake/modules/core/tools/cl.lua +++ b/xmake/modules/core/tools/cl.lua @@ -310,6 +310,9 @@ function _compile1(self, sourcefile, objectfile, incdepfile, flags) { function (errors) + -- try removing the old object file for forcing to rebuild this source file + os.tryrm(objectfile) + -- get prefix: "Note: including file:", @note maybe not english language local including_file = errors:match("\n(.-: .-:)%s*.-\r*\n") diff --git a/xmake/modules/core/tools/gcc.lua b/xmake/modules/core/tools/gcc.lua index 254f3301a..20192cf85 100644 --- a/xmake/modules/core/tools/gcc.lua +++ b/xmake/modules/core/tools/gcc.lua @@ -397,7 +397,10 @@ function _compile1(self, sourcefile, objectfile, incdepfile, flags) { function (errors) - -- compiling errors + -- try removing the old object file for forcing to rebuild this source file + os.tryrm(objectfile) + + -- raise compiling errors os.raise(errors) end }, |
