summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2018-11-24 22:54:41 +0800
committerruki <[email protected]>2018-11-24 22:54:41 +0800
commit4366dc9f6990917e32ece74fea8771b0f7a9457e (patch)
tree4d6aa07b8d27b9e81d7dec531c8b54678a1dd9e8
parent3eb86b3b9e59b87eb17605ce2c02bb453d55ba9a (diff)
improve templates
-rw-r--r--xmake/templates/c++/console_tbox/project/src/xmake.lua2
-rw-r--r--xmake/templates/c++/console_tbox/project/xmake.lua14
-rw-r--r--xmake/templates/c++/shared_library_tbox/project/src/_demo/xmake.lua2
-rw-r--r--xmake/templates/c++/shared_library_tbox/project/src/_library/xmake.lua2
-rw-r--r--xmake/templates/c++/shared_library_tbox/project/xmake.lua12
-rw-r--r--xmake/templates/c++/static_library_tbox/project/src/_demo/xmake.lua2
-rw-r--r--xmake/templates/c++/static_library_tbox/project/src/_library/xmake.lua2
-rw-r--r--xmake/templates/c++/static_library_tbox/project/xmake.lua12
-rw-r--r--xmake/templates/c/console_tbox/project/src/xmake.lua2
-rw-r--r--xmake/templates/c/console_tbox/project/xmake.lua12
-rw-r--r--xmake/templates/c/shared_library_tbox/project/src/_demo/xmake.lua2
-rw-r--r--xmake/templates/c/shared_library_tbox/project/src/_library/xmake.lua2
-rw-r--r--xmake/templates/c/shared_library_tbox/project/xmake.lua12
-rw-r--r--xmake/templates/c/static_library_tbox/project/src/_demo/xmake.lua2
-rw-r--r--xmake/templates/c/static_library_tbox/project/src/_library/xmake.lua2
-rw-r--r--xmake/templates/c/static_library_tbox/project/xmake.lua12
16 files changed, 41 insertions, 53 deletions
diff --git a/xmake/templates/c++/console_tbox/project/src/xmake.lua b/xmake/templates/c++/console_tbox/project/src/xmake.lua
index 708512305..35acd7238 100644
--- a/xmake/templates/c++/console_tbox/project/src/xmake.lua
+++ b/xmake/templates/c++/console_tbox/project/src/xmake.lua
@@ -11,7 +11,7 @@ target("[targetname]")
set_config_header("$(buildir)/[targetname].config.h", {prefix = "CONFIG"})
-- add packages
- add_packages("tbox", "base")
+ add_packages("tbox")
-- add files
add_files("*.cpp")
diff --git a/xmake/templates/c++/console_tbox/project/xmake.lua b/xmake/templates/c++/console_tbox/project/xmake.lua
index 0babdcd1e..83a45434f 100644
--- a/xmake/templates/c++/console_tbox/project/xmake.lua
+++ b/xmake/templates/c++/console_tbox/project/xmake.lua
@@ -1,5 +1,5 @@
-- version
-set_xmakever("2.1.6")
+set_xmakever("2.2.2")
-- set warning all as error
set_warnings("all", "error")
@@ -57,15 +57,13 @@ if is_plat("windows") then
add_ldflags("-nodefaultlib:msvcrt.lib")
end
--- the base package
-option("base")
- set_default(true)
- 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
+-- add syslinks
+if is_plat("windows") then add_syslinks("ws2_32")
+elseif is_plat("android") then add_syslinks("m", "c")
+else add_syslinks("pthread", "dl", "m", "c") end
-- add requires
-add_requires("tbox")
+add_requires("tbox", {debug = is_mode("debug")})
-- include project sources
includes("src")
diff --git a/xmake/templates/c++/shared_library_tbox/project/src/_demo/xmake.lua b/xmake/templates/c++/shared_library_tbox/project/src/_demo/xmake.lua
index c62de0ffd..c6f24eed7 100644
--- a/xmake/templates/c++/shared_library_tbox/project/src/_demo/xmake.lua
+++ b/xmake/templates/c++/shared_library_tbox/project/src/_demo/xmake.lua
@@ -14,5 +14,5 @@ target("demo")
add_files("*.cpp")
-- add packages
- add_packages("tbox", "base")
+ add_packages("tbox")
diff --git a/xmake/templates/c++/shared_library_tbox/project/src/_library/xmake.lua b/xmake/templates/c++/shared_library_tbox/project/src/_library/xmake.lua
index df545af4b..64efd521a 100644
--- a/xmake/templates/c++/shared_library_tbox/project/src/_library/xmake.lua
+++ b/xmake/templates/c++/shared_library_tbox/project/src/_library/xmake.lua
@@ -18,7 +18,7 @@ target("[targetname]")
add_includedirs("$(buildir)/[targetname]")
-- add packages
- add_packages("tbox", "base")
+ add_packages("tbox")
-- add files
add_files("*.cpp")
diff --git a/xmake/templates/c++/shared_library_tbox/project/xmake.lua b/xmake/templates/c++/shared_library_tbox/project/xmake.lua
index 472339253..37565d652 100644
--- a/xmake/templates/c++/shared_library_tbox/project/xmake.lua
+++ b/xmake/templates/c++/shared_library_tbox/project/xmake.lua
@@ -57,15 +57,13 @@ if is_plat("windows") then
add_ldflags("-nodefaultlib:msvcrt.lib")
end
--- the base package
-option("base")
- set_default(true)
- 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
+-- add syslinks
+if is_plat("windows") then add_syslinks("ws2_32")
+elseif is_plat("android") then add_syslinks("m", "c")
+else add_syslinks("pthread", "dl", "m", "c") end
-- add requires
-add_requires("tbox")
+add_requires("tbox", {debug = is_mode("debug")})
-- include project sources
includes("src/[targetname]", "src/[targetname]_demo")
diff --git a/xmake/templates/c++/static_library_tbox/project/src/_demo/xmake.lua b/xmake/templates/c++/static_library_tbox/project/src/_demo/xmake.lua
index c62de0ffd..c6f24eed7 100644
--- a/xmake/templates/c++/static_library_tbox/project/src/_demo/xmake.lua
+++ b/xmake/templates/c++/static_library_tbox/project/src/_demo/xmake.lua
@@ -14,5 +14,5 @@ target("demo")
add_files("*.cpp")
-- add packages
- add_packages("tbox", "base")
+ add_packages("tbox")
diff --git a/xmake/templates/c++/static_library_tbox/project/src/_library/xmake.lua b/xmake/templates/c++/static_library_tbox/project/src/_library/xmake.lua
index 57768c684..de917d8da 100644
--- a/xmake/templates/c++/static_library_tbox/project/src/_library/xmake.lua
+++ b/xmake/templates/c++/static_library_tbox/project/src/_library/xmake.lua
@@ -18,7 +18,7 @@ target("[targetname]")
add_includedirs("$(buildir)/[targetname]")
-- add packages
- add_packages("tbox", "base")
+ add_packages("tbox")
-- add files
add_files("*.cpp")
diff --git a/xmake/templates/c++/static_library_tbox/project/xmake.lua b/xmake/templates/c++/static_library_tbox/project/xmake.lua
index 472339253..37565d652 100644
--- a/xmake/templates/c++/static_library_tbox/project/xmake.lua
+++ b/xmake/templates/c++/static_library_tbox/project/xmake.lua
@@ -57,15 +57,13 @@ if is_plat("windows") then
add_ldflags("-nodefaultlib:msvcrt.lib")
end
--- the base package
-option("base")
- set_default(true)
- 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
+-- add syslinks
+if is_plat("windows") then add_syslinks("ws2_32")
+elseif is_plat("android") then add_syslinks("m", "c")
+else add_syslinks("pthread", "dl", "m", "c") end
-- add requires
-add_requires("tbox")
+add_requires("tbox", {debug = is_mode("debug")})
-- include project sources
includes("src/[targetname]", "src/[targetname]_demo")
diff --git a/xmake/templates/c/console_tbox/project/src/xmake.lua b/xmake/templates/c/console_tbox/project/src/xmake.lua
index c3b888cab..aeb4f9320 100644
--- a/xmake/templates/c/console_tbox/project/src/xmake.lua
+++ b/xmake/templates/c/console_tbox/project/src/xmake.lua
@@ -11,7 +11,7 @@ target("[targetname]")
set_config_header("$(buildir)/[targetname].config.h", {prefix = "CONFIG"})
-- add packages
- add_packages("tbox", "base")
+ add_packages("tbox")
-- add files
add_files("*.c")
diff --git a/xmake/templates/c/console_tbox/project/xmake.lua b/xmake/templates/c/console_tbox/project/xmake.lua
index 0babdcd1e..a9dbbc88e 100644
--- a/xmake/templates/c/console_tbox/project/xmake.lua
+++ b/xmake/templates/c/console_tbox/project/xmake.lua
@@ -57,15 +57,13 @@ if is_plat("windows") then
add_ldflags("-nodefaultlib:msvcrt.lib")
end
--- the base package
-option("base")
- set_default(true)
- 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
+-- add syslinks
+if is_plat("windows") then add_syslinks("ws2_32")
+elseif is_plat("android") then add_syslinks("m", "c")
+else add_syslinks("pthread", "dl", "m", "c") end
-- add requires
-add_requires("tbox")
+add_requires("tbox", {debug = is_mode("debug")})
-- include project sources
includes("src")
diff --git a/xmake/templates/c/shared_library_tbox/project/src/_demo/xmake.lua b/xmake/templates/c/shared_library_tbox/project/src/_demo/xmake.lua
index a180d7ee1..c62ddcec5 100644
--- a/xmake/templates/c/shared_library_tbox/project/src/_demo/xmake.lua
+++ b/xmake/templates/c/shared_library_tbox/project/src/_demo/xmake.lua
@@ -14,5 +14,5 @@ target("demo")
add_files("*.c")
-- add packages
- add_packages("tbox", "base")
+ add_packages("tbox")
diff --git a/xmake/templates/c/shared_library_tbox/project/src/_library/xmake.lua b/xmake/templates/c/shared_library_tbox/project/src/_library/xmake.lua
index 6a6f4e1d1..5dc1d6d79 100644
--- a/xmake/templates/c/shared_library_tbox/project/src/_library/xmake.lua
+++ b/xmake/templates/c/shared_library_tbox/project/src/_library/xmake.lua
@@ -18,7 +18,7 @@ target("[targetname]")
add_includedirs("$(buildir)/[targetname]")
-- add packages
- add_packages("tbox", "base")
+ add_packages("tbox")
-- add files
add_files("*.c")
diff --git a/xmake/templates/c/shared_library_tbox/project/xmake.lua b/xmake/templates/c/shared_library_tbox/project/xmake.lua
index 472339253..37565d652 100644
--- a/xmake/templates/c/shared_library_tbox/project/xmake.lua
+++ b/xmake/templates/c/shared_library_tbox/project/xmake.lua
@@ -57,15 +57,13 @@ if is_plat("windows") then
add_ldflags("-nodefaultlib:msvcrt.lib")
end
--- the base package
-option("base")
- set_default(true)
- 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
+-- add syslinks
+if is_plat("windows") then add_syslinks("ws2_32")
+elseif is_plat("android") then add_syslinks("m", "c")
+else add_syslinks("pthread", "dl", "m", "c") end
-- add requires
-add_requires("tbox")
+add_requires("tbox", {debug = is_mode("debug")})
-- include project sources
includes("src/[targetname]", "src/[targetname]_demo")
diff --git a/xmake/templates/c/static_library_tbox/project/src/_demo/xmake.lua b/xmake/templates/c/static_library_tbox/project/src/_demo/xmake.lua
index a180d7ee1..c62ddcec5 100644
--- a/xmake/templates/c/static_library_tbox/project/src/_demo/xmake.lua
+++ b/xmake/templates/c/static_library_tbox/project/src/_demo/xmake.lua
@@ -14,5 +14,5 @@ target("demo")
add_files("*.c")
-- add packages
- add_packages("tbox", "base")
+ add_packages("tbox")
diff --git a/xmake/templates/c/static_library_tbox/project/src/_library/xmake.lua b/xmake/templates/c/static_library_tbox/project/src/_library/xmake.lua
index 5c586451a..110018c07 100644
--- a/xmake/templates/c/static_library_tbox/project/src/_library/xmake.lua
+++ b/xmake/templates/c/static_library_tbox/project/src/_library/xmake.lua
@@ -18,7 +18,7 @@ target("[targetname]")
add_includedirs("$(buildir)/[targetname]")
-- add packages
- add_packages("tbox", "base")
+ add_packages("tbox")
-- add files
add_files("*.c")
diff --git a/xmake/templates/c/static_library_tbox/project/xmake.lua b/xmake/templates/c/static_library_tbox/project/xmake.lua
index 472339253..37565d652 100644
--- a/xmake/templates/c/static_library_tbox/project/xmake.lua
+++ b/xmake/templates/c/static_library_tbox/project/xmake.lua
@@ -57,15 +57,13 @@ if is_plat("windows") then
add_ldflags("-nodefaultlib:msvcrt.lib")
end
--- the base package
-option("base")
- set_default(true)
- 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
+-- add syslinks
+if is_plat("windows") then add_syslinks("ws2_32")
+elseif is_plat("android") then add_syslinks("m", "c")
+else add_syslinks("pthread", "dl", "m", "c") end
-- add requires
-add_requires("tbox")
+add_requires("tbox", {debug = is_mode("debug")})
-- include project sources
includes("src/[targetname]", "src/[targetname]_demo")