diff options
| author | ruki <[email protected]> | 2017-02-19 21:26:57 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2017-02-19 21:26:57 +0800 |
| commit | 5271cb2569ebe9b726f780f08c1a70ab844a0388 (patch) | |
| tree | 54fafee838e80d21436efd4756b1ca1974e7be18 | |
| parent | 0275b54732510124864604c379bb631056b97b12 (diff) | |
fix filter compiler errors for windows
| -rw-r--r--[-rwxr-xr-x] | xmake/tools/cl.lua | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/xmake/tools/cl.lua b/xmake/tools/cl.lua index 9e32839ea..b61fa31db 100755..100644 --- a/xmake/tools/cl.lua +++ b/xmake/tools/cl.lua @@ -251,9 +251,12 @@ function _compile1(sourcefile, objectfile, incdepfile, flags) { function (errors) + -- get prefix: "Note: including file:", @note maybe not english language + local including_file = errors:match("\n(.-: .-:)%s*.-\r*\n") + -- filter includes notes - if errors then - errors = errors:gsub("Note: including file:%s*.-\r*\n", "") + if errors and including_file then + errors = errors:gsub((including_file or "") .. ".-\r*\n", "") end os.raise(errors) end @@ -266,7 +269,7 @@ function _compile1(sourcefile, objectfile, incdepfile, flags) -- translate it local results = {} local uniques = {} - for includefile in string.gmatch(outdata, "including file:%s*(.-)\r*\n") do + for includefile in string.gmatch(outdata, ".-: .-:%s*(.-)\r*\n") do -- slower, only for debuging -- assert(os.isfile(includefile), "invalid include file: %s for %s", includefile, incdepfile) |
