summaryrefslogtreecommitdiff
path: root/xmake/plugins/project
diff options
context:
space:
mode:
authorruki <[email protected]>2023-11-15 16:34:08 +0800
committerGitHub <[email protected]>2023-11-15 16:34:08 +0800
commit6677fd77ee78b53a1f9bd4ce9665ce8b60083d47 (patch)
tree0094dfb752ac8e8816973f0db25b328c844d550f /xmake/plugins/project
parent4b102cbd2221494395e6e279ed453eee81ba45a4 (diff)
parent7c37e9b9b92b53e4384daea5193f826bf8ac9492 (diff)
Merge pull request #4373 from xmake-io/xpack
Support `xmake pack`
Diffstat (limited to 'xmake/plugins/project')
-rw-r--r--xmake/plugins/project/cmake/cmakelists.lua2
-rw-r--r--xmake/plugins/project/make/makefile.lua11
-rw-r--r--xmake/plugins/project/vstudio/impl/vs201x.lua2
3 files changed, 15 insertions, 0 deletions
diff --git a/xmake/plugins/project/cmake/cmakelists.lua b/xmake/plugins/project/cmake/cmakelists.lua
index fea241066..150720c1e 100644
--- a/xmake/plugins/project/cmake/cmakelists.lua
+++ b/xmake/plugins/project/cmake/cmakelists.lua
@@ -908,6 +908,8 @@ function _get_command_string(cmd, outputdir)
end
elseif kind == "rm" then
return string.format("${CMAKE_COMMAND} -E rm -rf %s", _get_relative_unix_path_to_cmake(cmd.filepath, outputdir))
+ elseif kind == "rmdir" then
+ return string.format("${CMAKE_COMMAND} -E rm -rf %s", _get_relative_unix_path_to_cmake(cmd.dir, outputdir))
elseif kind == "mv" then
return string.format("${CMAKE_COMMAND} -E rename %s %s",
_get_relative_unix_path_to_cmake(cmd.srcpath, outputdir), _get_relative_unix_path_to_cmake(cmd.dstpath, outputdir))
diff --git a/xmake/plugins/project/make/makefile.lua b/xmake/plugins/project/make/makefile.lua
index 7d2559ea1..7d462b138 100644
--- a/xmake/plugins/project/make/makefile.lua
+++ b/xmake/plugins/project/make/makefile.lua
@@ -215,6 +215,15 @@ function _get_cmd_rm(filedir)
end
end
+-- get command: rmdir
+function _get_cmd_rmdir(filedir)
+ if is_subhost("windows") then
+ return string.format("@rmdir /S /Q %s > NUL 2>&1", filedir)
+ else
+ return string.format("@rm -rf %s", filedir)
+ end
+end
+
-- get command: echo
function _get_cmd_echo(str)
return string.format("@echo %s", colors.ignore(str))
@@ -248,6 +257,8 @@ function _get_command_string(cmd, outputdir)
end
elseif kind == "rm" then
return _get_cmd_rm(_get_relative_unix_path(cmd.filepath, outputdir))
+ elseif kind == "rmdir" then
+ return _get_cmd_rmdir(_get_relative_unix_path(cmd.dir, outputdir))
elseif kind == "mv" then
return _get_cmd_mv(_get_relative_unix_path(cmd.srcpath, outputdir), _get_relative_unix_path(cmd.dstpath, outputdir))
elseif kind == "ln" then
diff --git a/xmake/plugins/project/vstudio/impl/vs201x.lua b/xmake/plugins/project/vstudio/impl/vs201x.lua
index 3b6f145f4..a8b48dada 100644
--- a/xmake/plugins/project/vstudio/impl/vs201x.lua
+++ b/xmake/plugins/project/vstudio/impl/vs201x.lua
@@ -102,6 +102,8 @@ function _get_command_string(cmd, vcxprojdir)
return string.format("copy /Y \"%s\" \"%s\"", _translate_path(cmd.srcpath, vcxprojdir), _translate_path(cmd.dstpath, vcxprojdir))
elseif kind == "rm" then
return string.format("del /F /Q \"%s\" || rmdir /S /Q \"%s\"", _translate_path(cmd.filepath, vcxprojdir), _translate_path(cmd.filepath, vcxprojdir))
+ elseif kind == "rmdir" then
+ return string.format("rmdir /S /Q \"%s\"", _translate_path(cmd.filepath, vcxprojdir))
elseif kind == "mv" then
return string.format("rename \"%s\" \"%s\"", _translate_path(cmd.srcpath, vcxprojdir), _translate_path(cmd.dstpath, vcxprojdir))
elseif kind == "cd" then