diff options
Diffstat (limited to 'xmake')
| -rw-r--r-- | xmake/toolchains/clang-cl/check.lua | 13 | ||||
| -rw-r--r-- | xmake/toolchains/msvc/check.lua | 13 |
2 files changed, 24 insertions, 2 deletions
diff --git a/xmake/toolchains/clang-cl/check.lua b/xmake/toolchains/clang-cl/check.lua index b416a44ce..9f7022482 100644 --- a/xmake/toolchains/clang-cl/check.lua +++ b/xmake/toolchains/clang-cl/check.lua @@ -137,7 +137,6 @@ function _check_vc_build_tools(toolchain, sdkdir) end end --- main entry function main(toolchain) -- only for windows or linux (msvc-wine) @@ -154,6 +153,18 @@ function main(toolchain) if sdkdir then return _check_vc_build_tools(toolchain, sdkdir) else + -- find it from packages + for _, package in ipairs(toolchain:packages()) do + local installdir = package:installdir() + if installdir and os.isdir(installdir) then + local result = _check_vc_build_tools(toolchain, installdir) + if result then + return result + end + end + end + + -- find it from system return _check_vstudio(toolchain) end end diff --git a/xmake/toolchains/msvc/check.lua b/xmake/toolchains/msvc/check.lua index 3c70d43c0..c40d4a202 100644 --- a/xmake/toolchains/msvc/check.lua +++ b/xmake/toolchains/msvc/check.lua @@ -128,7 +128,6 @@ function _check_vc_build_tools(toolchain, sdkdir) end end --- main entry function main(toolchain) -- only for windows or linux (msvc-wine) @@ -145,6 +144,18 @@ function main(toolchain) if sdkdir then return _check_vc_build_tools(toolchain, sdkdir) else + -- find it from packages + for _, package in ipairs(toolchain:packages()) do + local installdir = package:installdir() + if installdir and os.isdir(installdir) then + local result = _check_vc_build_tools(toolchain, installdir) + if result then + return result + end + end + end + + -- find it from system return _check_vstudio(toolchain) end end |
