summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2016-02-14 21:32:36 +0800
committerruki <[email protected]>2016-02-15 19:10:27 +0800
commit00db421c6d1fcb4604015e30fbc3ce80e9c00b41 (patch)
tree156038808d71a3bbdd66959604293ebc7aa31f94
parent52c273079851f2b83b9c632aec8e37b7482f6a83 (diff)
rename add_target and add_option to def_xxx
-rwxr-xr-xREADME.md10
-rw-r--r--tests/console/src/demo/xmake.lua10
-rw-r--r--tests/console/xmake.lua18
-rw-r--r--tests/interpreter/scope.lua4
-rw-r--r--xmake/core/base/package.lua2
-rw-r--r--xmake/core/base/project.lua8
-rw-r--r--xmake/templates/c++/console/project/xmake.lua2
-rw-r--r--xmake/templates/c++/console_tbox/project/src/xmake.lua2
-rw-r--r--xmake/templates/c++/shared_library/project/xmake.lua4
-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.lua2
-rw-r--r--xmake/templates/c++/static_library/project/xmake.lua4
-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.lua2
-rw-r--r--xmake/templates/c/console/project/xmake.lua2
-rw-r--r--xmake/templates/c/console_tbox/project/src/xmake.lua2
-rw-r--r--xmake/templates/c/shared_library/project/xmake.lua4
-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.lua2
-rw-r--r--xmake/templates/c/static_library/project/xmake.lua4
-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.lua2
-rw-r--r--xmake/templates/objc++/console/project/xmake.lua2
-rw-r--r--xmake/templates/objc/console/project/xmake.lua2
-rw-r--r--xmake/templates/swift/console/project/xmake.lua2
29 files changed, 53 insertions, 53 deletions
diff --git a/README.md b/README.md
index 1ce0f9e16..4c5a4ba3c 100755
--- a/README.md
+++ b/README.md
@@ -27,7 +27,7 @@ It is similar to cmake, automake, premake, but more convenient and easy to use.
```lua
-- xmake.lua
- add_target("console")
+ def_target("console")
-- set kind
set_kind("binary")
@@ -50,7 +50,7 @@ create a c++ console project:
project makefile:xmake.lua
```lua
-add_target("console")
+def_target("console")
set_kind("binary")
add_files("src/*.c")
```
@@ -146,7 +146,7 @@ if modes("release") then
end
-- add target
-add_target("test")
+def_target("test")
-- set kind
set_kind("static")
@@ -240,7 +240,7 @@ XMake是一个跨平台自动构建工具,支持在各种主流平台上构建
工程描述文件:xmake.lua
```lua
-add_target("console")
+def_target("console")
set_kind("binary")
add_files("src/*.c")
```
@@ -352,7 +352,7 @@ if modes("release") then
end
-- add target
-add_target("test")
+def_target("test")
-- set kind
set_kind("static")
diff --git a/tests/console/src/demo/xmake.lua b/tests/console/src/demo/xmake.lua
index f304aa255..6585054be 100644
--- a/tests/console/src/demo/xmake.lua
+++ b/tests/console/src/demo/xmake.lua
@@ -1,5 +1,5 @@
-add_target("demo_c")
+def_target("demo_c")
set_kind("binary")
add_deps("hello1")
add_files("*.c")
@@ -14,7 +14,7 @@ add_target("demo_c")
if options("option3") then add_defines("OPTION3") end
if options("option4") then add_defines("OPTION4") end
-add_target("demo_cpp")
+def_target("demo_cpp")
set_kind("binary")
add_deps("hello2")
add_files("*.cpp")
@@ -31,7 +31,7 @@ add_target("demo_cpp")
if plats("macosx", "ios") then
- add_target("demo_objc")
+ def_target("demo_objc")
set_kind("binary")
add_deps("hello3")
add_files("*.m")
@@ -40,7 +40,7 @@ add_target("demo_cpp")
add_includedirs("$(buildir)/inc")
add_mflags("-DHELLO3", "-DPLAT=\"macosx\"", "-DARCH='armv7, arm64'")
- add_target("demo_objcpp")
+ def_target("demo_objcpp")
set_kind("binary")
add_deps("hello3")
add_files("*.mm")
@@ -52,6 +52,6 @@ add_target("demo_cpp")
end
end
-add_target("demo_swift")
+def_target("demo_swift")
set_kind("binary")
add_files("*.swift")
diff --git a/tests/console/xmake.lua b/tests/console/xmake.lua
index 01406f127..b4cf57d58 100644
--- a/tests/console/xmake.lua
+++ b/tests/console/xmake.lua
@@ -27,13 +27,13 @@ if archs("x86", "x64") then
add_defines("ARCH=\"$(arch)\"", "PLAT=$(plat)", "MODE=$(mode)", "HOST=$(host)")
end
-add_option("option1")
+def_option("option1")
set_option_enable(true)
set_option_showmenu(true)
add_option_defines_h_if_ok("OPTION1_ENABLE")
set_option_description("The option for definition and need not check.")
-add_option("option2")
+def_option("option2")
set_option_enable(false)
set_option_showmenu(true)
add_option_defines_h_if_ok("OPTION2_ENABLE")
@@ -41,7 +41,7 @@ add_option("option2")
add_option_includedirs("src/hello1")
set_option_description("The option for finding includes.")
-add_option("option3")
+def_option("option3")
set_option_enable(false)
set_option_showmenu(true)
add_option_defines_h_if_ok("OPTION3_ENABLE")
@@ -49,7 +49,7 @@ add_option("option3")
add_option_linkdirs("$(buildir)")
set_option_description("The option for finding links.")
-add_option("option4")
+def_option("option4")
set_option_enable(false)
set_option_showmenu(true)
add_option_defines_h_if_ok("OPTION4_ENABLE")
@@ -60,15 +60,15 @@ add_option("option4")
add_option_cincludes("stdio.h", "sqlite3.h")
end
-add_target("hello1")
+def_target("hello1")
set_kind("static")
add_files("src/hello1/*.c")
-add_target("hello2")
+def_target("hello2")
set_kind("shared")
add_files("$(projectdir)/src/hello2/*.c")
-add_target("hello3")
+def_target("hello3")
set_kind("static")
add_files("src/hello3/*.c")
add_headers("src/(hello3/*.h)")
@@ -76,13 +76,13 @@ add_target("hello3")
set_targetdir("$(buildir)/lib")
set_objectdir("$(buildir)/obj")
-add_target("hello4")
+def_target("hello4")
set_kind("static")
add_deps("hello1", "hello2")
add_files("$(buildir)/.objs/hello1/**.o")
add_files("$(buildir)/.objs/hello2/**.obj")
-add_target("hello5")
+def_target("hello5")
set_kind("static")
add_deps("hello4", "hello1")
add_files("$(buildir)/hello1.lib")
diff --git a/tests/interpreter/scope.lua b/tests/interpreter/scope.lua
index 2893dfeaf..dbc532587 100644
--- a/tests/interpreter/scope.lua
+++ b/tests/interpreter/scope.lua
@@ -2,12 +2,12 @@
set_kind("static")
add_files("root.c")
-add_target("target1")
+def_target("target1")
set_kind("static")
add_files("*.c", "hello.c")
add_files("$(projectdir)/test.c")
-add_option("option1")
+def_option("option1")
add_option_links("pthread", "z")
diff --git a/xmake/core/base/package.lua b/xmake/core/base/package.lua
index 1b3f154af..5290ea47f 100644
--- a/xmake/core/base/package.lua
+++ b/xmake/core/base/package.lua
@@ -97,7 +97,7 @@ function package._done_library(target)
-- the xmake.lua template content
local template = [[
-- add [targetname] package
-add_option("[targetname]")
+def_option("[targetname]")
-- show menu
set_option_showmenu(true)
diff --git a/xmake/core/base/project.lua b/xmake/core/base/project.lua
index 621fc8b05..2bdbad5f6 100644
--- a/xmake/core/base/project.lua
+++ b/xmake/core/base/project.lua
@@ -149,7 +149,7 @@ function project._api_add_cfunc(interp, module, alias, links, includes, cfunc)
local scope = interp:scope_save()
-- make option
- interp:api_call("add_option", name)
+ interp:api_call("def_option", name)
interp:api_call("set_option_category", "cfuncs")
interp:api_call("add_option_cfuncs", cfunc)
if links then interp:api_call("add_option_links", links) end
@@ -195,7 +195,7 @@ function project._api_add_cfuncs(interp, module, links, includes, ...)
local scope = interp:scope_save()
-- make option
- interp:api_call("add_option", name)
+ interp:api_call("def_option", name)
interp:api_call("set_option_category", "cfuncs")
interp:api_call("add_option_cfuncs", cfunc)
if links then interp:api_call("add_option_links", links) end
@@ -236,7 +236,7 @@ function project._api_add_cxxfunc(interp, module, alias, links, includes, cxxfun
local scope = interp:scope_save()
-- make option
- interp:api_call("add_option", name)
+ interp:api_call("def_option", name)
interp:api_call("set_option_category", "cxxfuncs")
interp:api_call("add_option_cxxfuncs", cxxfunc)
if links then interp:api_call("add_option_links", links) end
@@ -282,7 +282,7 @@ function project._api_add_cxxfuncs(interp, module, links, includes, ...)
local scope = interp:scope_save()
-- make option
- interp:api_call("add_option", name)
+ interp:api_call("def_option", name)
interp:api_call("set_option_category", "cxxfuncs")
interp:api_call("add_option_cxxfuncs", cxxfunc)
if links then interp:api_call("add_option_links", links) end
diff --git a/xmake/templates/c++/console/project/xmake.lua b/xmake/templates/c++/console/project/xmake.lua
index 30aca7364..c858ef1e5 100644
--- a/xmake/templates/c++/console/project/xmake.lua
+++ b/xmake/templates/c++/console/project/xmake.lua
@@ -22,7 +22,7 @@ if modes("release") then
end
-- add target
-add_target("[targetname]")
+def_target("[targetname]")
-- set kind
set_kind("binary")
diff --git a/xmake/templates/c++/console_tbox/project/src/xmake.lua b/xmake/templates/c++/console_tbox/project/src/xmake.lua
index f42ad3a71..eb49c4706 100644
--- a/xmake/templates/c++/console_tbox/project/src/xmake.lua
+++ b/xmake/templates/c++/console_tbox/project/src/xmake.lua
@@ -1,5 +1,5 @@
-- add target
-add_target("[targetname]")
+def_target("[targetname]")
-- set kind
set_kind("binary")
diff --git a/xmake/templates/c++/shared_library/project/xmake.lua b/xmake/templates/c++/shared_library/project/xmake.lua
index b776097d8..a8f13b901 100644
--- a/xmake/templates/c++/shared_library/project/xmake.lua
+++ b/xmake/templates/c++/shared_library/project/xmake.lua
@@ -22,7 +22,7 @@ if modes("release") then
end
-- add target
-add_target("[targetname]")
+def_target("[targetname]")
-- set kind
set_kind("shared")
@@ -31,7 +31,7 @@ add_target("[targetname]")
add_files("src/interface.cpp")
-- add target
-add_target("test")
+def_target("test")
-- set kind
set_kind("binary")
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 deeb9db4a..d2b9ae2e9 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
@@ -1,5 +1,5 @@
-- add target
-add_target("demo")
+def_target("demo")
-- set kind
set_kind("binary")
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 f22611058..608fb2455 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
@@ -1,5 +1,5 @@
-- add target
-add_target("[targetname]")
+def_target("[targetname]")
-- set kind
set_kind("shared")
diff --git a/xmake/templates/c++/shared_library_tbox/project/xmake.lua b/xmake/templates/c++/shared_library_tbox/project/xmake.lua
index 3509970b7..61e135480 100644
--- a/xmake/templates/c++/shared_library_tbox/project/xmake.lua
+++ b/xmake/templates/c++/shared_library_tbox/project/xmake.lua
@@ -105,7 +105,7 @@ if plats("windows") then
end
-- add option: demo
-add_option("demo")
+def_option("demo")
set_option_enable(true)
set_option_showmenu(true)
set_option_category("option")
diff --git a/xmake/templates/c++/static_library/project/xmake.lua b/xmake/templates/c++/static_library/project/xmake.lua
index 56774575e..4f088bf9e 100644
--- a/xmake/templates/c++/static_library/project/xmake.lua
+++ b/xmake/templates/c++/static_library/project/xmake.lua
@@ -22,7 +22,7 @@ if modes("release") then
end
-- add target
-add_target("[targetname]")
+def_target("[targetname]")
-- set kind
set_kind("static")
@@ -31,7 +31,7 @@ add_target("[targetname]")
add_files("src/interface.cpp")
-- add target
-add_target("test")
+def_target("test")
-- set kind
set_kind("binary")
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 deeb9db4a..d2b9ae2e9 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
@@ -1,5 +1,5 @@
-- add target
-add_target("demo")
+def_target("demo")
-- set kind
set_kind("binary")
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 206605202..4a975ad66 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
@@ -1,5 +1,5 @@
-- add target
-add_target("[targetname]")
+def_target("[targetname]")
-- set kind
set_kind("static")
diff --git a/xmake/templates/c++/static_library_tbox/project/xmake.lua b/xmake/templates/c++/static_library_tbox/project/xmake.lua
index 3509970b7..61e135480 100644
--- a/xmake/templates/c++/static_library_tbox/project/xmake.lua
+++ b/xmake/templates/c++/static_library_tbox/project/xmake.lua
@@ -105,7 +105,7 @@ if plats("windows") then
end
-- add option: demo
-add_option("demo")
+def_option("demo")
set_option_enable(true)
set_option_showmenu(true)
set_option_category("option")
diff --git a/xmake/templates/c/console/project/xmake.lua b/xmake/templates/c/console/project/xmake.lua
index 30aca7364..c858ef1e5 100644
--- a/xmake/templates/c/console/project/xmake.lua
+++ b/xmake/templates/c/console/project/xmake.lua
@@ -22,7 +22,7 @@ if modes("release") then
end
-- add target
-add_target("[targetname]")
+def_target("[targetname]")
-- set kind
set_kind("binary")
diff --git a/xmake/templates/c/console_tbox/project/src/xmake.lua b/xmake/templates/c/console_tbox/project/src/xmake.lua
index 3f6e5b51c..5270285f8 100644
--- a/xmake/templates/c/console_tbox/project/src/xmake.lua
+++ b/xmake/templates/c/console_tbox/project/src/xmake.lua
@@ -1,5 +1,5 @@
-- add target
-add_target("[targetname]")
+def_target("[targetname]")
-- set kind
set_kind("binary")
diff --git a/xmake/templates/c/shared_library/project/xmake.lua b/xmake/templates/c/shared_library/project/xmake.lua
index f6d15d851..20684126f 100644
--- a/xmake/templates/c/shared_library/project/xmake.lua
+++ b/xmake/templates/c/shared_library/project/xmake.lua
@@ -22,7 +22,7 @@ if modes("release") then
end
-- add target
-add_target("[targetname]")
+def_target("[targetname]")
-- set kind
set_kind("shared")
@@ -31,7 +31,7 @@ add_target("[targetname]")
add_files("src/interface.c")
-- add target
-add_target("test")
+def_target("test")
-- set kind
set_kind("binary")
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 c750a9b70..8de43bb2b 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
@@ -1,5 +1,5 @@
-- add target
-add_target("demo")
+def_target("demo")
-- set kind
set_kind("binary")
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 6f67ab2fe..6fcedbf29 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
@@ -1,5 +1,5 @@
-- add target
-add_target("[targetname]")
+def_target("[targetname]")
-- set kind
set_kind("shared")
diff --git a/xmake/templates/c/shared_library_tbox/project/xmake.lua b/xmake/templates/c/shared_library_tbox/project/xmake.lua
index 3509970b7..61e135480 100644
--- a/xmake/templates/c/shared_library_tbox/project/xmake.lua
+++ b/xmake/templates/c/shared_library_tbox/project/xmake.lua
@@ -105,7 +105,7 @@ if plats("windows") then
end
-- add option: demo
-add_option("demo")
+def_option("demo")
set_option_enable(true)
set_option_showmenu(true)
set_option_category("option")
diff --git a/xmake/templates/c/static_library/project/xmake.lua b/xmake/templates/c/static_library/project/xmake.lua
index 148b7b268..26dd4e68c 100644
--- a/xmake/templates/c/static_library/project/xmake.lua
+++ b/xmake/templates/c/static_library/project/xmake.lua
@@ -22,7 +22,7 @@ if modes("release") then
end
-- add target
-add_target("[targetname]")
+def_target("[targetname]")
-- set kind
set_kind("static")
@@ -31,7 +31,7 @@ add_target("[targetname]")
add_files("src/interface.c")
-- add target
-add_target("test")
+def_target("test")
-- set kind
set_kind("binary")
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 c750a9b70..8de43bb2b 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
@@ -1,5 +1,5 @@
-- add target
-add_target("demo")
+def_target("demo")
-- set kind
set_kind("binary")
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 6c4ffbd5d..851328464 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
@@ -1,5 +1,5 @@
-- add target
-add_target("[targetname]")
+def_target("[targetname]")
-- set kind
set_kind("static")
diff --git a/xmake/templates/c/static_library_tbox/project/xmake.lua b/xmake/templates/c/static_library_tbox/project/xmake.lua
index 3509970b7..61e135480 100644
--- a/xmake/templates/c/static_library_tbox/project/xmake.lua
+++ b/xmake/templates/c/static_library_tbox/project/xmake.lua
@@ -105,7 +105,7 @@ if plats("windows") then
end
-- add option: demo
-add_option("demo")
+def_option("demo")
set_option_enable(true)
set_option_showmenu(true)
set_option_category("option")
diff --git a/xmake/templates/objc++/console/project/xmake.lua b/xmake/templates/objc++/console/project/xmake.lua
index b051ac9df..6f8ce1bf6 100644
--- a/xmake/templates/objc++/console/project/xmake.lua
+++ b/xmake/templates/objc++/console/project/xmake.lua
@@ -33,7 +33,7 @@ if os("macosx", "ios") then
end
-- add target
-add_target("[targetname]")
+def_target("[targetname]")
-- set kind
set_kind("binary")
diff --git a/xmake/templates/objc/console/project/xmake.lua b/xmake/templates/objc/console/project/xmake.lua
index 5e08682d5..eb59e833f 100644
--- a/xmake/templates/objc/console/project/xmake.lua
+++ b/xmake/templates/objc/console/project/xmake.lua
@@ -33,7 +33,7 @@ if os("macosx", "ios") then
end
-- add target
-add_target("[targetname]")
+def_target("[targetname]")
-- set kind
set_kind("binary")
diff --git a/xmake/templates/swift/console/project/xmake.lua b/xmake/templates/swift/console/project/xmake.lua
index f4aef294d..b4ac31e27 100644
--- a/xmake/templates/swift/console/project/xmake.lua
+++ b/xmake/templates/swift/console/project/xmake.lua
@@ -22,7 +22,7 @@ if modes("release") then
end
-- add target
-add_target("[targetname]")
+def_target("[targetname]")
-- set kind
set_kind("binary")