diff options
| author | ImperatorS79 <[email protected]> | 2022-08-13 16:15:49 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-08-13 16:15:49 +0200 |
| commit | bc9544477ef938865ac6519f7914877ec126d802 (patch) | |
| tree | 33e364f0d2fd0405285cd09272f70a942bc5cc4e | |
| parent | 3e74e829daa4b6eb66f0a19b9547cfea063e1514 (diff) | |
Update find_package.lua
| -rw-r--r-- | xmake/modules/package/manager/pacman/find_package.lua | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/xmake/modules/package/manager/pacman/find_package.lua b/xmake/modules/package/manager/pacman/find_package.lua index f3010a888..c0167cfd7 100644 --- a/xmake/modules/package/manager/pacman/find_package.lua +++ b/xmake/modules/package/manager/pacman/find_package.lua @@ -29,16 +29,14 @@ function _find_package_from_list(list, name, pacman, opt) -- mingw + pacman = cygpath available local cygpath = nil - local pathtomsys2 = "" + local pathtomsys2 = nil if is_subhost("msys") and opt.plat == "mingw" then cygpath = find_tool("cygpath") if not cygpath then return end pathtomsys = os.iorunv(cygpath.program, {"--windows", "/"}) - if pathtomsys:endswith("\n") then - pathtomsys = pathtomsys:sub(1, -2) - end + pathtomsys = pathtomsys:trim() end -- iterate over each file path inside the pacman package @@ -51,10 +49,10 @@ function _find_package_from_list(list, name, pacman, opt) if is_subhost("msys") and opt.plat == "mingw" then hpath = path.join(pathtomsys, line) if opt.arch == "x86_64" then - local basehpath = path.join(pathtomsys, "/mingw64/include") + local basehpath = path.join(pathtomsys, "mingw64/include") table.insert(result.includedirs, basehpath) else - local basehpath = path.join(pathtomsys, "/mingw32/include") + local basehpath = path.join(pathtomsys, "mingw32/include") table.insert(result.includedirs, basehpath) end end @@ -95,7 +93,7 @@ function _find_package_from_list(list, name, pacman, opt) result.version = version:split('-')[1] else result = nil - end + end return result end |
