summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Ivy III <[email protected]>2018-10-31 12:17:17 -0500
committerRoy Ivy III <[email protected]>2018-10-31 12:52:35 -0500
commit46376463b39d25a0aeb688cc5dfa3ca374d5c2b0 (patch)
treecf191b441ef786da56004be48a9319560d0f47fd
parent06481639fce5515f1708e23367aab5bfa20f0e53 (diff)
improve find_vstudio ~ minor fixes
* use `tonumber()` conversion instead of `(x + 0)` (more explicit) * remove redundant listing of VC/VS versions
-rw-r--r--xmake/modules/detect/sdks/find_vstudio.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/xmake/modules/detect/sdks/find_vstudio.lua b/xmake/modules/detect/sdks/find_vstudio.lua
index 3f375feac..fadf99345 100644
--- a/xmake/modules/detect/sdks/find_vstudio.lua
+++ b/xmake/modules/detect/sdks/find_vstudio.lua
@@ -218,13 +218,13 @@ function main(opt)
-- find vs2017 -> vs4.2
local results = {}
- for _, version in ipairs({"15.0", "14.0", "12.0", "11.0", "10.0", "9.0", "8.0", "7.1", "7.0", "6.0", "5.0", "4.2"}) do
+ for version in pairs(vsvers) do
-- find VC install path (and aux build path) using `vswhere` (for version >= 15.0)
-- * version > 15.0 eschews registry entries; but `vswhere` (included with version >= 15.2) can be used to find VC install path
-- ref: https://github.com/Microsoft/vswhere/blob/master/README.md @@ https://archive.is/mEmdu
local vswhere_VCAuxiliaryBuildDir = nil
- if ((version + 0) >= 15) and vswhere then
+ if (tonumber(version) >= 15) and vswhere then
local vswhere_vrange = format("%s,%s)", version, (version + 1))
local result = os.iorunv(vswhere.program, {"-property", "installationpath", "-version", vswhere_vrange})
if result then