diff options
| author | ruki <[email protected]> | 2025-02-13 22:26:22 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-02-13 22:26:22 +0800 |
| commit | d262159c14679842aa2c70103f03a46558bb4241 (patch) | |
| tree | 3c8ff227a0feb88f1041476d816450b3fe21e9c6 | |
| parent | ecabee75fcf97d10f82fe3d8aff2bef34991bca7 (diff) | |
| parent | 51ffaa0cd3ac067c58598e1e1cad1b0ba7f3d68e (diff) | |
Merge pull request #6151 from star-hengxing/msys2
Remove msystem include on msys2
| -rw-r--r-- | xmake/modules/package/manager/pacman/find_package.lua | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/xmake/modules/package/manager/pacman/find_package.lua b/xmake/modules/package/manager/pacman/find_package.lua index d939192ec..1369bd055 100644 --- a/xmake/modules/package/manager/pacman/find_package.lua +++ b/xmake/modules/package/manager/pacman/find_package.lua @@ -52,14 +52,16 @@ function _find_package_from_list(list, name, pacman, opt) 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/") 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 (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 |
