summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2016-09-17 21:57:37 +0800
committerruki <[email protected]>2016-09-17 21:57:37 +0800
commitaba84c853df6f3c8be8813af8937ba525f9a37fd (patch)
tree5cfb662b27a8cdc7937bebedfd03301d47fc2233
parente788d5d76f6c18de62df4653f87773bbd74d806a (diff)
remove packages for templates
-rw-r--r--xmake/core/_xmake_main.lua1
-rw-r--r--xmake/core/project/template.lua1
-rw-r--r--xmake/templates/c/console_tbox/project/pkg/base.pkg/xmake.lua11
-rw-r--r--xmake/templates/c/console_tbox/template.lua6
-rw-r--r--xmake/templates/c/shared_library_tbox/project/pkg/base.pkg/xmake.lua11
-rw-r--r--xmake/templates/c/shared_library_tbox/template.lua5
-rw-r--r--xmake/templates/c/static_library_tbox/project/pkg/base.pkg/xmake.lua11
-rw-r--r--xmake/templates/c/static_library_tbox/template.lua6
8 files changed, 39 insertions, 13 deletions
diff --git a/xmake/core/_xmake_main.lua b/xmake/core/_xmake_main.lua
index 7895b0300..95f29072b 100644
--- a/xmake/core/_xmake_main.lua
+++ b/xmake/core/_xmake_main.lua
@@ -32,7 +32,6 @@ xmake._PROGRAM_DIR = _PROGRAM_DIR
xmake._PROJECT_DIR = _PROJECT_DIR
xmake._CORE_DIR = _PROGRAM_DIR .. "/core"
xmake._TOOLS_DIR = _PROGRAM_DIR .. "/tools"
-xmake._PACKAGES_DIR = _PROGRAM_DIR .. "/packages"
xmake._TEMPLATES_DIR = _PROGRAM_DIR .. "/templates"
xmake._PROJECT_FILE = "xmake.lua"
diff --git a/xmake/core/project/template.lua b/xmake/core/project/template.lua
index d2f045695..d80283677 100644
--- a/xmake/core/project/template.lua
+++ b/xmake/core/project/template.lua
@@ -180,7 +180,6 @@ function template.create(language, templateid, targetname)
{
targetname = targetname
, projectdir = project.directory()
- , packagesdir = xmake._PACKAGES_DIR
}
-- map it
diff --git a/xmake/templates/c/console_tbox/project/pkg/base.pkg/xmake.lua b/xmake/templates/c/console_tbox/project/pkg/base.pkg/xmake.lua
new file mode 100644
index 000000000..db521e677
--- /dev/null
+++ b/xmake/templates/c/console_tbox/project/pkg/base.pkg/xmake.lua
@@ -0,0 +1,11 @@
+-- the base package
+option("base")
+
+ -- set category
+ set_category("package")
+
+ -- add links
+ if is_os("windows") then add_links("ws2_32")
+ elseif is_os("android") then add_links("m", "c")
+ else add_links("pthread", "dl", "m", "c") end
+
diff --git a/xmake/templates/c/console_tbox/template.lua b/xmake/templates/c/console_tbox/template.lua
index 43928ba4e..6f4ea81db 100644
--- a/xmake/templates/c/console_tbox/template.lua
+++ b/xmake/templates/c/console_tbox/template.lua
@@ -13,8 +13,6 @@ add_macrofiles("src/xmake.lua")
-- set create script
on_create(function ()
- -- copy packages
- os.cp("$(packagesdir)/tbox.pkg", "pkg/tbox.pkg")
- os.cp("$(packagesdir)/base.pkg", "pkg/base.pkg")
-
+ -- show tips
+ print("please put tbox.pkg into pkg before building it!")
end)
diff --git a/xmake/templates/c/shared_library_tbox/project/pkg/base.pkg/xmake.lua b/xmake/templates/c/shared_library_tbox/project/pkg/base.pkg/xmake.lua
new file mode 100644
index 000000000..db521e677
--- /dev/null
+++ b/xmake/templates/c/shared_library_tbox/project/pkg/base.pkg/xmake.lua
@@ -0,0 +1,11 @@
+-- the base package
+option("base")
+
+ -- set category
+ set_category("package")
+
+ -- add links
+ if is_os("windows") then add_links("ws2_32")
+ elseif is_os("android") then add_links("m", "c")
+ else add_links("pthread", "dl", "m", "c") end
+
diff --git a/xmake/templates/c/shared_library_tbox/template.lua b/xmake/templates/c/shared_library_tbox/template.lua
index d8fc84ee0..daa3d90cc 100644
--- a/xmake/templates/c/shared_library_tbox/template.lua
+++ b/xmake/templates/c/shared_library_tbox/template.lua
@@ -20,8 +20,7 @@ on_create(function ()
os.mv("src/_library", "src/$(targetname)")
os.mv("src/_demo", "src/$(targetname)_demo")
- -- copy packages
- os.cp("$(packagesdir)/tbox.pkg", "pkg/tbox.pkg")
- os.cp("$(packagesdir)/base.pkg", "pkg/base.pkg")
+ -- show tips
+ print("please put tbox.pkg into pkg before building it!")
end)
diff --git a/xmake/templates/c/static_library_tbox/project/pkg/base.pkg/xmake.lua b/xmake/templates/c/static_library_tbox/project/pkg/base.pkg/xmake.lua
new file mode 100644
index 000000000..db521e677
--- /dev/null
+++ b/xmake/templates/c/static_library_tbox/project/pkg/base.pkg/xmake.lua
@@ -0,0 +1,11 @@
+-- the base package
+option("base")
+
+ -- set category
+ set_category("package")
+
+ -- add links
+ if is_os("windows") then add_links("ws2_32")
+ elseif is_os("android") then add_links("m", "c")
+ else add_links("pthread", "dl", "m", "c") end
+
diff --git a/xmake/templates/c/static_library_tbox/template.lua b/xmake/templates/c/static_library_tbox/template.lua
index 6a1a6c732..835308bce 100644
--- a/xmake/templates/c/static_library_tbox/template.lua
+++ b/xmake/templates/c/static_library_tbox/template.lua
@@ -20,8 +20,6 @@ on_create(function ()
os.mv("src/_library", "src/$(targetname)")
os.mv("src/_demo", "src/$(targetname)_demo")
- -- copy packages
- os.cp("$(packagesdir)/tbox.pkg", "pkg/tbox.pkg")
- os.cp("$(packagesdir)/base.pkg", "pkg/base.pkg")
-
+ -- show tips
+ print("please put tbox.pkg into pkg before building it!")
end)