diff options
| author | ruki <[email protected]> | 2018-11-03 08:22:45 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2018-11-03 08:22:45 +0800 |
| commit | 7fd1ac068ed4d25b9fafcde4b94b27f768d2bd32 (patch) | |
| tree | 6bfd38af92c94bfee5cd213fc2607567b6396445 | |
| parent | 046f525a9e54802e7071bcbfb25124e4c8c7c194 (diff) | |
| parent | 8c6cd6b4dc6b6a6b18150480d9711595f0043f26 (diff) | |
Merge pull request #248 from rivy/rev.find_vstudio
fix + minor improvements to `find_vstudio`
| -rw-r--r-- | xmake/modules/detect/sdks/find_vstudio.lua | 4 | ||||
| -rw-r--r-- | xmake/platforms/windows/check.lua | 2 |
2 files changed, 3 insertions, 3 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 diff --git a/xmake/platforms/windows/check.lua b/xmake/platforms/windows/check.lua index 34c8f004f..9ac599815 100644 --- a/xmake/platforms/windows/check.lua +++ b/xmake/platforms/windows/check.lua @@ -49,7 +49,7 @@ function _check_vsenv(config) table.insert(vsvers, vsver) end end - table.sort(vsvers, function (a, b) return a > b end) + table.sort(vsvers, function (a, b) return tonumber(a) > tonumber(b) end) if vs then table.insert(vsvers, 1, vs) end |
