summaryrefslogtreecommitdiff
path: root/xmake/modules/detect
diff options
context:
space:
mode:
authorruki <[email protected]>2020-10-20 00:55:14 +0800
committerruki <[email protected]>2020-10-20 00:55:14 +0800
commit1fd9fbb24a9bbca21d3783c5fbe49fe74ad54ca8 (patch)
treead37c68602195ab915f06ec176b2115b12c69666 /xmake/modules/detect
parent415059e05bab56da2ebc429155d55bbaf2efcd39 (diff)
improve to find_vcpkgdir
Diffstat (limited to 'xmake/modules/detect')
-rw-r--r--xmake/modules/detect/sdks/find_vcpkgdir.lua12
1 files changed, 10 insertions, 2 deletions
diff --git a/xmake/modules/detect/sdks/find_vcpkgdir.lua b/xmake/modules/detect/sdks/find_vcpkgdir.lua
index de8cba24e..8df048f25 100644
--- a/xmake/modules/detect/sdks/find_vcpkgdir.lua
+++ b/xmake/modules/detect/sdks/find_vcpkgdir.lua
@@ -42,8 +42,16 @@ function _find_vcpkgdir(sdkdir)
table.insert(paths, dir)
end
end
- else
- -- TODO
+ end
+
+ -- attempt to find it from the $PATH
+ local pathenv = os.getenv("PATH")
+ if pathenv then
+ for _, p in ipairs(path.splitenv(pathenv)) do
+ if p:find(string.ipattern("[\\/]vcpkg")) and os.isdir(p) then
+ table.insert(paths, p)
+ end
+ end
end
-- attempt to find vcpkg