summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2019-09-19 22:33:49 +0800
committerruki <[email protected]>2019-09-19 09:22:54 +0800
commit056b041bdc1b7fa832dc1a0d3cc11e3525005696 (patch)
tree5b373fdb5db8f9538fd5e0385b69da1a6116b6e3
parent336029c68e4d0fc58bb55dca3ce5fb62bfdbf41b (diff)
fix tbox template
-rw-r--r--xmake/actions/create/main.lua2
-rw-r--r--xmake/templates/c++/tbox.shared/template.lua6
-rw-r--r--xmake/templates/c++/tbox.static/template.lua6
-rw-r--r--xmake/templates/c/tbox.shared/template.lua6
-rw-r--r--xmake/templates/c/tbox.static/template.lua6
5 files changed, 13 insertions, 13 deletions
diff --git a/xmake/actions/create/main.lua b/xmake/actions/create/main.lua
index eeeb7ade4..2a9e894bc 100644
--- a/xmake/actions/create/main.lua
+++ b/xmake/actions/create/main.lua
@@ -65,7 +65,7 @@ function _create_project(tempinst, sourcedir, targetname)
-- do after_create
local after_create = tempinst:get("create_after")
if after_create then
- after_create(tempinst)
+ after_create(tempinst, {targetname = targetname})
end
end
diff --git a/xmake/templates/c++/tbox.shared/template.lua b/xmake/templates/c++/tbox.shared/template.lua
index b89f57c26..14fa4dbda 100644
--- a/xmake/templates/c++/tbox.shared/template.lua
+++ b/xmake/templates/c++/tbox.shared/template.lua
@@ -3,7 +3,7 @@ template("tbox.shared")
add_configfiles("src/_demo/main.cpp")
add_configfiles("src/_demo/xmake.lua")
add_configfiles("src/_library/xmake.lua")
- after_create(function (template)
- os.mv("src/_library", "src/${TARGETNAME}")
- os.mv("src/_demo", "src/${TARGETNAME}_demo")
+ after_create(function (template, opt)
+ os.mv("src/_library", path.join("src", opt.targetname))
+ os.mv("src/_demo", path.join("src", opt.targetname .. "_demo"))
end)
diff --git a/xmake/templates/c++/tbox.static/template.lua b/xmake/templates/c++/tbox.static/template.lua
index b49207e48..acc4e21bd 100644
--- a/xmake/templates/c++/tbox.static/template.lua
+++ b/xmake/templates/c++/tbox.static/template.lua
@@ -3,7 +3,7 @@ template("tbox.static")
add_configfiles("src/_demo/main.cpp")
add_configfiles("src/_demo/xmake.lua")
add_configfiles("src/_library/xmake.lua")
- after_create(function (template)
- os.mv("src/_library", "src/${TARGETNAME}")
- os.mv("src/_demo", "src/${TARGETNAME}_demo")
+ after_create(function (template, opt)
+ os.mv("src/_library", path.join("src", opt.targetname))
+ os.mv("src/_demo", path.join("src", opt.targetname .. "_demo"))
end)
diff --git a/xmake/templates/c/tbox.shared/template.lua b/xmake/templates/c/tbox.shared/template.lua
index 57f706e99..cf21d02a7 100644
--- a/xmake/templates/c/tbox.shared/template.lua
+++ b/xmake/templates/c/tbox.shared/template.lua
@@ -3,7 +3,7 @@ template("tbox.shared")
add_configfiles("src/_demo/main.c")
add_configfiles("src/_demo/xmake.lua")
add_configfiles("src/_library/xmake.lua")
- after_create(function (template)
- os.mv("src/_library", "src/${TARGETNAME}")
- os.mv("src/_demo", "src/${TARGETNAME}_demo")
+ after_create(function (template, opt)
+ os.mv("src/_library", path.join("src", opt.targetname))
+ os.mv("src/_demo", path.join("src", opt.targetname .. "_demo"))
end)
diff --git a/xmake/templates/c/tbox.static/template.lua b/xmake/templates/c/tbox.static/template.lua
index 8d71d43ee..21c09ec3c 100644
--- a/xmake/templates/c/tbox.static/template.lua
+++ b/xmake/templates/c/tbox.static/template.lua
@@ -3,7 +3,7 @@ template("tbox.static")
add_configfiles("src/_demo/main.c")
add_configfiles("src/_demo/xmake.lua")
add_configfiles("src/_library/xmake.lua")
- after_create(function (template)
- os.mv("src/_library", "src/${TARGETNAME}")
- os.mv("src/_demo", "src/${TARGETNAME}_demo")
+ after_create(function (template, opt)
+ os.mv("src/_library", path.join("src", opt.targetname))
+ os.mv("src/_demo", path.join("src", opt.targetname .. "_demo"))
end)