summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmake/modules/package/tools/cmake.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/xmake/modules/package/tools/cmake.lua b/xmake/modules/package/tools/cmake.lua
index d8b4a7a6f..6daf89491 100644
--- a/xmake/modules/package/tools/cmake.lua
+++ b/xmake/modules/package/tools/cmake.lua
@@ -558,7 +558,12 @@ function _get_configs_for_host_toolchain(package, configs, opt)
name = name:gsub("clang%-", "clang++-")
name = name:gsub("gcc$", "g++")
name = name:gsub("gcc%-", "g++-")
- envs.CMAKE_CXX_COMPILER = _translate_bin_path(dir and path.join(dir, name) or name)
+ if dir and dir ~= "." then
+ cxx = path.join(dir, name)
+ else
+ cxx = name
+ end
+ envs.CMAKE_CXX_COMPILER = _translate_bin_path(cxx)
end
-- @note The link command line is set in Modules/CMake{C,CXX,Fortran}Information.cmake and defaults to using the compiler, not CMAKE_LINKER,
-- so we need set CMAKE_CXX_LINK_EXECUTABLE to use CMAKE_LINKER as linker.