summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2022-05-31 00:49:52 +0800
committerruki <[email protected]>2022-05-31 00:49:52 +0800
commit50c5f96edb3f6c7a45e1bd24c921ec2c0afac33f (patch)
treed31984135a64d2ec002742b8a4831d50464ea1eb
parent4c4c0c945be1fa76af7d90f46d85fb514a55b6d9 (diff)
improve path and cmakelists
-rw-r--r--xmake/core/base/path.lua4
-rw-r--r--xmake/plugins/project/cmake/cmakelists.lua2
2 files changed, 3 insertions, 3 deletions
diff --git a/xmake/core/base/path.lua b/xmake/core/base/path.lua
index 421797f07..bd0701702 100644
--- a/xmake/core/base/path.lua
+++ b/xmake/core/base/path.lua
@@ -128,8 +128,8 @@ function _instance:__concat(other)
if path.instance_of(self) then
return path.new(path.join(self:str(), tostring(other)), self._TRANSFORM)
elseif type(self) == "string" then
- return path.new(self, function (p)
- return self .. tostring(other)
+ return path.new(tostring(other), function (p)
+ return self .. p
end)
else
os.raise("cannot concat %s/%s", tostring(self), type(self))
diff --git a/xmake/plugins/project/cmake/cmakelists.lua b/xmake/plugins/project/cmake/cmakelists.lua
index 4ccb67670..e94f4e2f4 100644
--- a/xmake/plugins/project/cmake/cmakelists.lua
+++ b/xmake/plugins/project/cmake/cmakelists.lua
@@ -661,7 +661,7 @@ function _get_command_string(cmd, outputdir)
end
table.insert(argv, v)
end
- local command = cmd.program .. " " .. os.args(argv)
+ local command = _get_unix_path_relative_to_cmake(cmd.program) .. " " .. os.args(argv)
if opt and opt.curdir then
command = "${CMAKE_COMMAND} -E chdir " .. _get_unix_path_relative_to_cmake(opt.curdir, outputdir) .. " " .. command
end