diff options
| -rw-r--r-- | xmake/modules/package/tools/cmake.lua | 4 | ||||
| -rw-r--r-- | xmake/toolchains/msvc/check.lua | 8 |
2 files changed, 7 insertions, 5 deletions
diff --git a/xmake/modules/package/tools/cmake.lua b/xmake/modules/package/tools/cmake.lua index d0055422d..64f7bea3a 100644 --- a/xmake/modules/package/tools/cmake.lua +++ b/xmake/modules/package/tools/cmake.lua @@ -452,10 +452,10 @@ function _get_configs_for_windows(package, configs, opt) end -- use clang-cl - if package:has_tool("cc", "clang_cl") then + if package:has_tool("cc", "clang", "clang_cl") then table.insert(configs, "-DCMAKE_C_COMPILER=" .. _translate_bin_path(package:build_getenv("cc"))) end - if package:has_tool("cxx", "clang_cl") then + if package:has_tool("cxx", "clang", "clang_cl") then table.insert(configs, "-DCMAKE_CXX_COMPILER=" .. _translate_bin_path(package:build_getenv("cxx"))) end diff --git a/xmake/toolchains/msvc/check.lua b/xmake/toolchains/msvc/check.lua index c2ed4bbb6..be4de243d 100644 --- a/xmake/toolchains/msvc/check.lua +++ b/xmake/toolchains/msvc/check.lua @@ -142,8 +142,9 @@ function main(toolchain) if cc == "cl" or cxx == "cl" or mrc == "rc" then local sdkdir = toolchain:sdkdir() if sdkdir then - return _check_vc_build_tools(toolchain, sdkdir) - else + sdkdir = _check_vc_build_tools(toolchain, sdkdir) + end + if not sdkdir then -- find it from packages for _, package in ipairs(toolchain:packages()) do local installdir = package:installdir() @@ -156,8 +157,9 @@ function main(toolchain) end -- find it from system - return _check_vstudio(toolchain) + sdkdir = _check_vstudio(toolchain) end + return sdkdir end end |
