summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author西风逍遥游 <[email protected]>2022-06-23 21:23:51 -0700
committer西风逍遥游 <[email protected]>2022-06-23 21:23:51 -0700
commit572365e7db9f37269863809ea0bb10d59de8f4cb (patch)
tree8370629dc72d1d74c11bab3d86c182772f8fdc7a
parent7c2a56b1b5e46abc2c0a9898943e897ba9b5a4ac (diff)
Fix include paths of pacman packages
-rw-r--r--xmake/modules/package/manager/pacman/find_package.lua22
1 files changed, 12 insertions, 10 deletions
diff --git a/xmake/modules/package/manager/pacman/find_package.lua b/xmake/modules/package/manager/pacman/find_package.lua
index f10b4a93a..41b9355e5 100644
--- a/xmake/modules/package/manager/pacman/find_package.lua
+++ b/xmake/modules/package/manager/pacman/find_package.lua
@@ -41,19 +41,21 @@ function _find_package_from_list(list, name, pacman, opt)
for _, line in ipairs(list:split('\n', {plain = true})) do -- on msys cygpath should be used to convert local path to windows path
line = line:trim():split('%s+')[2]
if line:find("/include/", 1, true) and (line:endswith(".h") or line:endswith(".hpp")) then
- local hpath = line
- if is_subhost("msys") and opt.plat == "mingw" then
- hpath = os.iorunv(cygpath.program, {"--windows", line})
+ if not line:startswith("/usr/include/") then
+ local hpath = line
+ if is_subhost("msys") and opt.plat == "mingw" then
+ hpath = os.iorunv(cygpath.program, {"--windows", line})
- if opt.arch == "x86_64" then
- local basehpath = os.iorunv(cygpath.program, {"--windows", "/mingw64/include"})
- table.insert(result.includedirs, basehpath)
- else
- local basehpath = os.iorunv(cygpath.program, {"--windows", "/mingw32/include"})
- table.insert(result.includedirs, basehpath)
+ if opt.arch == "x86_64" then
+ local basehpath = os.iorunv(cygpath.program, {"--windows", "/mingw64/include"})
+ table.insert(result.includedirs, basehpath)
+ else
+ local basehpath = os.iorunv(cygpath.program, {"--windows", "/mingw32/include"})
+ table.insert(result.includedirs, basehpath)
+ end
end
+ table.insert(result.includedirs, path.directory(hpath))
end
- table.insert(result.includedirs, path.directory(hpath))
-- remove lib and .a, .dll.a and .so to have the links
elseif line:endswith(".dll.a") then -- only for mingw
local apath = os.iorunv(cygpath.program, {"--windows", line})