summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2025-09-06 22:48:41 +0800
committerGitHub <[email protected]>2025-09-06 22:48:41 +0800
commit85c59645d59cfab5f61b5f75160b676621544890 (patch)
tree9fbf82f9fd373c69bb1861d065a0cb94fdb4b3bd
parente2cd53a8bc9593c20aeb5c77a4a02fc38585f91e (diff)
parent39d0fbd5ce88ea1a921d0d0d58419de2147b462e (diff)
Merge pull request #6777 from xmake-io/cmake
fix executable path for cmake #6768
-rw-r--r--xmake/plugins/project/cmake/cmakelists.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/xmake/plugins/project/cmake/cmakelists.lua b/xmake/plugins/project/cmake/cmakelists.lua
index 52820620a..a5ec312cb 100644
--- a/xmake/plugins/project/cmake/cmakelists.lua
+++ b/xmake/plugins/project/cmake/cmakelists.lua
@@ -32,6 +32,7 @@ import("private.utils.batchcmds")
import("private.utils.target", {alias = "target_utils"})
import("plugins.project.utils.target_cmds", {rootdir = os.programdir()})
import("rules.c++.modules.support", {alias = "module_support", rootdir = os.programdir()})
+import("private.utils.executable_path")
-- get cmake version
function _get_cmake_version()
@@ -302,7 +303,7 @@ function _set_compiler(cmakelists)
if config.get("toolchain") then
local cc = platform.tool("cc")
if cc then
- cc = path.unix(cc)
+ cc = path.unix(executable_path(cc))
cmakelists:print("set(CMAKE_C_COMPILER \"%s\")", cc)
end
local cxx, cxx_name = platform.tool("cxx")
@@ -320,7 +321,7 @@ function _set_compiler(cmakelists)
cxx = name
end
end
- cxx = path.unix(cxx)
+ cxx = path.unix(executable_path(cxx))
cmakelists:print("set(CMAKE_CXX_COMPILER \"%s\")", cxx)
end
end