summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstar9029 <[email protected]>2025-09-25 16:53:12 +0800
committerGitHub <[email protected]>2025-09-25 16:53:12 +0800
commit89b712ae5bee4c8235ba69d5b7e1a38b51884932 (patch)
tree7c8d910f92e45c32454c3eaa89be4556f6c32c1f
parent106d342f0e555c209bf73a3a736038904110d06b (diff)
Fix rc compiler with cmake in cross-compilation
-rw-r--r--xmake/modules/package/tools/cmake.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/xmake/modules/package/tools/cmake.lua b/xmake/modules/package/tools/cmake.lua
index 509d250f2..2099481bd 100644
--- a/xmake/modules/package/tools/cmake.lua
+++ b/xmake/modules/package/tools/cmake.lua
@@ -625,8 +625,11 @@ function _get_configs_for_cross(package, configs, opt)
envs.CMAKE_CXX_COMPILER = _translate_bin_path(package:build_getenv("cxx"))
envs.CMAKE_ASM_COMPILER = _translate_bin_path(package:build_getenv("as"))
envs.CMAKE_AR = _translate_bin_path(package:build_getenv("ar"))
- if package:is_plat("windows") and package:has_tool("cxx", "cl") then
- envs.CMAKE_AR = path.join(path.directory(envs.CMAKE_CXX_COMPILER), "lib.exe")
+ if package:is_plat("windows") then
+ envs.CMAKE_RC_COMPILER = _translate_bin_path(package:build_getenv("mrc"))
+ if package:has_tool("cxx", "cl") then
+ envs.CMAKE_AR = path.join(path.directory(envs.CMAKE_CXX_COMPILER), "lib.exe")
+ end
end
_fix_cxx_compiler_cmake(package, envs)
-- @note The link command line is set in Modules/CMake{C,CXX,Fortran}Information.cmake and defaults to using the compiler, not CMAKE_LINKER,