diff options
| author | Arthur LAURENT <[email protected]> | 2025-05-05 20:30:34 +0200 |
|---|---|---|
| committer | Arthur LAURENT <[email protected]> | 2025-05-05 20:30:34 +0200 |
| commit | 255102b4a1f85d88e1ccd3dccc3c2c3135bbf274 (patch) | |
| tree | 3e15284b40d788d58cb9246d22a8946bbf463b50 | |
| parent | 2774ecbc0961e1e2b1f995d8937b44c2c90e11c6 (diff) | |
(cmake) when using --toolchain=llvm on windows, dependencies should be build with it
| -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 |
