diff options
| author | ruki <[email protected]> | 2020-10-08 21:03:38 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-10-08 21:03:38 +0800 |
| commit | a0b8b710f6b502071d80b1626d344981b70f0ba2 (patch) | |
| tree | 37d13f83df600ff4f80ab767f70cfd2f71cff679 | |
| parent | a50b405f67e77cff01ec9b2e5c18a77429809a36 (diff) | |
fix parse_deps_json
| -rw-r--r-- | xmake/modules/private/tools/cl/parse_deps_json.lua | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/xmake/modules/private/tools/cl/parse_deps_json.lua b/xmake/modules/private/tools/cl/parse_deps_json.lua index f02da5fe4..49a103d94 100644 --- a/xmake/modules/private/tools/cl/parse_deps_json.lua +++ b/xmake/modules/private/tools/cl/parse_deps_json.lua @@ -37,17 +37,18 @@ function main(depsdata) -- translate it local results = hashset.new() + local projectdir = os.projectdir():lower() -- we need generate lower string, because json values are all lower for _, includefile in ipairs(includes) do - -- get the relative - includefile = path.relative(includefile, project.directory()) - includefile = path.absolute(includefile) + -- get the absolute path + if not path.is_absolute(includefile) then + includefile = path.absolute(includefile, projectdir):lower() + end -- save it if belong to the project - if includefile:startswith(os.projectdir()) then - + if includefile:startswith(projectdir) then -- insert it and filter repeat - includefile = path.relative(includefile, project.directory()) + includefile = path.relative(includefile, projectdir) results:insert(includefile) end end |
