summaryrefslogtreecommitdiff
path: root/xmake/plugins/project/make/makefile.lua
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/plugins/project/make/makefile.lua')
-rw-r--r--xmake/plugins/project/make/makefile.lua15
1 files changed, 15 insertions, 0 deletions
diff --git a/xmake/plugins/project/make/makefile.lua b/xmake/plugins/project/make/makefile.lua
index f43e75f2d..cae9806f0 100644
--- a/xmake/plugins/project/make/makefile.lua
+++ b/xmake/plugins/project/make/makefile.lua
@@ -186,6 +186,19 @@ function _get_cmd_mv(sourcefile, targetfile)
end
end
+-- get command: ln
+function _get_cmd_ln(sourcefile, targetfile)
+ if is_subhost("windows") then
+ if os.isdir(sourcefile) then
+ return string.format("@mklink /D %s %s > NUL 2>&1", sourcefile, targetfile)
+ else
+ return string.format("@mklink %s %s > NUL 2>&1", sourcefile, targetfile)
+ end
+ else
+ return string.format("@ln -s %s %s", sourcefile, targetfile)
+ end
+end
+
-- get command: cpdir
function _get_cmd_cpdir(sourcedir, targetdir)
if is_subhost("windows") then
@@ -240,6 +253,8 @@ function _get_command_string(cmd, outputdir)
return _get_cmd_rm(_get_relative_unix_path(cmd.filepath, 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
+ return _get_cmd_ln(_get_relative_unix_path(cmd.srcpath, outputdir), _get_relative_unix_path(cmd.dstpath, outputdir))
elseif kind == "cd" then
return _get_cmd_cd(_get_relative_unix_path(cmd.dir, outputdir))
elseif kind == "mkdir" then