summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2025-05-06 11:23:37 +0800
committerGitHub <[email protected]>2025-05-06 11:23:37 +0800
commita4d1b8c7ee7caa4d48ce8182e948e5058c005ec0 (patch)
tree3aa9ce8ee37c9824bc0923bae16edc6f6be9306f
parent9fa95319d2701e0cbf983f14549a29c26dc68498 (diff)
parent255102b4a1f85d88e1ccd3dccc3c2c3135bbf274 (diff)
Merge pull request #6381 from Arthapz/fix-llvm-cmake-windows
(cmake, llvm toolchain) when using --toolchain=llvm on windows, dependencies should be build with it
-rw-r--r--xmake/modules/package/tools/cmake.lua4
-rw-r--r--xmake/toolchains/msvc/check.lua8
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