diff options
| author | ruki <[email protected]> | 2020-10-21 22:33:13 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-10-21 22:33:13 +0800 |
| commit | e5372b5cf8b5902222808b5d103521bfaa54ca3e (patch) | |
| tree | 1a5f2a3ffd50a60d868ac2c35a4517cefb9172a7 | |
| parent | 4742314df2f1f3120dca49ff7308dd4f0e601d20 (diff) | |
improve find_package for vcpkg
| -rw-r--r-- | xmake/modules/package/manager/vcpkg/find_package.lua | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/xmake/modules/package/manager/vcpkg/find_package.lua b/xmake/modules/package/manager/vcpkg/find_package.lua index 1296e9330..fecf9e3c3 100644 --- a/xmake/modules/package/manager/vcpkg/find_package.lua +++ b/xmake/modules/package/manager/vcpkg/find_package.lua @@ -76,6 +76,9 @@ function main(name, opt) if info then for _, line in ipairs(info:split('\n')) do line = line:trim() + if plat == "windows" then + line = line:lower() + end -- get includedirs if line:endswith("/include/") then @@ -118,6 +121,16 @@ function main(name, opt) result.version = infoname:match(name .. "_(%d+%.?%d*%.-)_" .. arch) end end + + -- remove repeat + if result then + if result.linkdirs then + result.linkdirs = table.unique(result.linkdirs) + end + if result.includedirs then + result.includedirs = table.unique(result.includedirs) + end + end return result end |
