Skip to content

Commit a4d1b8c

Browse files
authored
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
2 parents 9fa9531 + 255102b commit a4d1b8c

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

xmake/modules/package/tools/cmake.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,10 +452,10 @@ function _get_configs_for_windows(package, configs, opt)
452452
end
453453

454454
-- use clang-cl
455-
if package:has_tool("cc", "clang_cl") then
455+
if package:has_tool("cc", "clang", "clang_cl") then
456456
table.insert(configs, "-DCMAKE_C_COMPILER=" .. _translate_bin_path(package:build_getenv("cc")))
457457
end
458-
if package:has_tool("cxx", "clang_cl") then
458+
if package:has_tool("cxx", "clang", "clang_cl") then
459459
table.insert(configs, "-DCMAKE_CXX_COMPILER=" .. _translate_bin_path(package:build_getenv("cxx")))
460460
end
461461

xmake/toolchains/msvc/check.lua

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,9 @@ function main(toolchain)
142142
if cc == "cl" or cxx == "cl" or mrc == "rc" then
143143
local sdkdir = toolchain:sdkdir()
144144
if sdkdir then
145-
return _check_vc_build_tools(toolchain, sdkdir)
146-
else
145+
sdkdir = _check_vc_build_tools(toolchain, sdkdir)
146+
end
147+
if not sdkdir then
147148
-- find it from packages
148149
for _, package in ipairs(toolchain:packages()) do
149150
local installdir = package:installdir()
@@ -156,8 +157,9 @@ function main(toolchain)
156157
end
157158

158159
-- find it from system
159-
return _check_vstudio(toolchain)
160+
sdkdir = _check_vstudio(toolchain)
160161
end
162+
return sdkdir
161163
end
162164
end
163165

0 commit comments

Comments
 (0)