summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2021-07-17 10:57:53 +0800
committerruki <[email protected]>2021-07-17 10:57:53 +0800
commit1037efd6700cc9211a888c8090be10d272c6c6d5 (patch)
tree44dee04d9f0e8147416fb82cf4b56135d4540433
parentcc3a1942dae6444f192fc14a9bf32bd07120fff4 (diff)
improve to find vcpkg dir
-rw-r--r--xmake/modules/detect/sdks/find_vcpkgdir.lua10
-rw-r--r--xmake/modules/detect/tools/find_vcpkg.lua10
2 files changed, 10 insertions, 10 deletions
diff --git a/xmake/modules/detect/sdks/find_vcpkgdir.lua b/xmake/modules/detect/sdks/find_vcpkgdir.lua
index d2f6bd3fd..4645895eb 100644
--- a/xmake/modules/detect/sdks/find_vcpkgdir.lua
+++ b/xmake/modules/detect/sdks/find_vcpkgdir.lua
@@ -57,6 +57,16 @@ function main()
end
end
end
+ if not vcpkgdir and is_host("windows") then
+ -- attempt to read path info after running `vcpkg integrate install`
+ local pathfile = "~/../Local/vcpkg/vcpkg.path.txt"
+ if os.isfile(pathfile) then
+ local dir = io.readfile(pathfile):trim()
+ if os.isdir(dir) then
+ vcpkgdir = dir
+ end
+ end
+ end
detectcache:set("detect.sdks.find_vcpkgdir", vcpkgdir or false)
detectcache:save()
end
diff --git a/xmake/modules/detect/tools/find_vcpkg.lua b/xmake/modules/detect/tools/find_vcpkg.lua
index 46ae1ea36..7f4dc37a8 100644
--- a/xmake/modules/detect/tools/find_vcpkg.lua
+++ b/xmake/modules/detect/tools/find_vcpkg.lua
@@ -50,16 +50,6 @@ function main(opt)
if vcpkgdir then
table.insert(paths, vcpkgdir)
end
- if is_host("windows") then
- -- attempt to read path info after running `vcpkg integrate install`
- local pathfile = "~/../Local/vcpkg/vcpkg.path.txt"
- if os.isfile(pathfile) then
- local dir = io.readfile(pathfile):trim()
- if os.isdir(dir) then
- table.insert(paths, dir)
- end
- end
- end
-- find program
opt.paths = paths