diff options
| author | star9029 <[email protected]> | 2025-02-13 17:34:57 +0800 |
|---|---|---|
| committer | star9029 <[email protected]> | 2025-02-13 17:34:57 +0800 |
| commit | 51ffaa0cd3ac067c58598e1e1cad1b0ba7f3d68e (patch) | |
| tree | 933b4ac8593d6047279d4fba10ceec23b2655cfc | |
| parent | 5759db1efe705d2aaaf2ce62a8cc93bd8aa02e52 (diff) | |
improve msystem include
| -rw-r--r-- | xmake/modules/package/manager/pacman/find_package.lua | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/xmake/modules/package/manager/pacman/find_package.lua b/xmake/modules/package/manager/pacman/find_package.lua index 961a4b85e..1369bd055 100644 --- a/xmake/modules/package/manager/pacman/find_package.lua +++ b/xmake/modules/package/manager/pacman/find_package.lua @@ -48,19 +48,20 @@ function _find_package_from_list(list, name, pacman, opt) -- iterate over each file path inside the pacman package local result = {} - local msystem_include = msystem and "/" .. msystem .. "/include/" or "" 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 - if not line:startswith("/usr/include/") and not line:startswith(msystem_include) then - result.includedirs = result.includedirs or {} - local hpath = line - if is_subhost("msys") and opt.plat == "mingw" then - hpath = path.join(pathtomsys, line) - local basehpath = path.join(pathtomsys, msystem .. "/include") - table.insert(result.includedirs, basehpath) + if not line:startswith("/usr/include/") then + if not (msystem and line:startswith("/" .. msystem .. "/include/")) then + result.includedirs = result.includedirs or {} + local hpath = line + if is_subhost("msys") and opt.plat == "mingw" then + hpath = path.join(pathtomsys, line) + local basehpath = path.join(pathtomsys, msystem .. "/include") + table.insert(result.includedirs, basehpath) + end + table.insert(result.includedirs, path.directory(hpath)) end - table.insert(result.includedirs, path.directory(hpath)) end -- remove lib and .a, .dll.a and .so to have the links elseif line:endswith(".dll.a") then -- only for mingw |
