diff options
| author | ruki <[email protected]> | 2019-09-19 00:55:37 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2019-09-18 23:33:46 +0800 |
| commit | 336029c68e4d0fc58bb55dca3ce5fb62bfdbf41b (patch) | |
| tree | 68072128ac59708b7f56615e626d87e30ed951e2 /xmake/templates/dlang | |
| parent | bb3455b845e0b776937283b3ddae4ae557eea52e (diff) | |
rewrite templates
Diffstat (limited to 'xmake/templates/dlang')
| -rw-r--r-- | xmake/templates/dlang/console/project/xmake.lua | 4 | ||||
| -rw-r--r-- | xmake/templates/dlang/console/template.lua | 16 | ||||
| -rw-r--r-- | xmake/templates/dlang/shared/project/xmake.lua | 40 | ||||
| -rw-r--r-- | xmake/templates/dlang/shared/template.lua | 16 | ||||
| -rw-r--r-- | xmake/templates/dlang/static/project/xmake.lua | 40 | ||||
| -rw-r--r-- | xmake/templates/dlang/static/template.lua | 16 |
6 files changed, 20 insertions, 112 deletions
diff --git a/xmake/templates/dlang/console/project/xmake.lua b/xmake/templates/dlang/console/project/xmake.lua index de662d1b4..9f27dbf7f 100644 --- a/xmake/templates/dlang/console/project/xmake.lua +++ b/xmake/templates/dlang/console/project/xmake.lua @@ -1,9 +1,8 @@ - -- add modes: debug and release add_rules("mode.debug", "mode.release") -- add target -target("[targetname]") +target("${TARGETNAME}") -- set kind set_kind("binary") @@ -11,3 +10,4 @@ target("[targetname]") -- add files add_files("src/*.d") +${FAQ} diff --git a/xmake/templates/dlang/console/template.lua b/xmake/templates/dlang/console/template.lua index 52c362723..ed2e13b57 100644 --- a/xmake/templates/dlang/console/template.lua +++ b/xmake/templates/dlang/console/template.lua @@ -1,14 +1,2 @@ --- set name -set_name("console") - --- set description -set_description("The Console Program") - --- set project directory -set_projectdir("project") - --- add macros -add_macros("targetname", "$(targetname)") - --- add macro files -add_macrofiles("xmake.lua") +template("console") + add_configfiles("xmake.lua") diff --git a/xmake/templates/dlang/shared/project/xmake.lua b/xmake/templates/dlang/shared/project/xmake.lua index 962994618..7fe11f488 100644 --- a/xmake/templates/dlang/shared/project/xmake.lua +++ b/xmake/templates/dlang/shared/project/xmake.lua @@ -1,28 +1,8 @@ --- the debug mode -if is_mode("debug") then - - -- enable the debug symbols - set_symbols("debug") - - -- disable optimization - set_optimize("none") -end - --- the release mode -if is_mode("release") then - - -- set the symbols visibility: hidden - set_symbols("hidden") - - -- enable fastest optimization - set_optimize("fastest") - - -- strip all symbols - set_strip("all") -end +-- add modes: debug and release +add_rules("mode.debug", "mode.release") -- add target -target("[targetname]") +target("${TARGETNAME}") -- set kind set_kind("shared") @@ -31,23 +11,15 @@ target("[targetname]") add_files("src/interfaces.d") -- add target -target("[targetname]_demo") +target("${TARGETNAME}_demo") -- set kind set_kind("binary") -- add deps - add_deps("test") + add_deps("${TARGETNAME}") -- add files add_files("src/main.d") - -- add links - add_links("[targetname]") - - -- add link directory - add_linkdirs("$(buildir)") - - -- add include directory - add_includedirs("$(projectdir)/src") - +${FAQ} diff --git a/xmake/templates/dlang/shared/template.lua b/xmake/templates/dlang/shared/template.lua index 666542844..d7ec5bae4 100644 --- a/xmake/templates/dlang/shared/template.lua +++ b/xmake/templates/dlang/shared/template.lua @@ -1,14 +1,2 @@ --- set name -set_name("shared") - --- set description -set_description("The Shared Library") - --- set project directory -set_projectdir("project") - --- add macros -add_macros("targetname", "$(targetname)") - --- add macro files -add_macrofiles("xmake.lua") +template("shared") + add_configfiles("xmake.lua") diff --git a/xmake/templates/dlang/static/project/xmake.lua b/xmake/templates/dlang/static/project/xmake.lua index 8cc9d7d9d..6a3d805ad 100644 --- a/xmake/templates/dlang/static/project/xmake.lua +++ b/xmake/templates/dlang/static/project/xmake.lua @@ -1,28 +1,8 @@ --- the debug mode -if is_mode("debug") then - - -- enable the debug symbols - set_symbols("debug") - - -- disable optimization - set_optimize("none") -end - --- the release mode -if is_mode("release") then - - -- set the symbols visibility: hidden - set_symbols("hidden") - - -- enable fastest optimization - set_optimize("fastest") - - -- strip all symbols - set_strip("all") -end +-- add modes: debug and release +add_rules("mode.debug", "mode.release") -- add target -target("[targetname]") +target("${TARGETNAME}") -- set kind set_kind("static") @@ -31,23 +11,15 @@ target("[targetname]") add_files("src/interfaces.d") -- add target -target("[targetname]_demo") +target("${TARGETNAME}_demo") -- set kind set_kind("binary") -- add deps - add_deps("[targetname]") + add_deps("${TARGETNAME}") -- add files add_files("src/main.d") - -- add links - add_links("[targetname]") - - -- add link directory - add_linkdirs("$(buildir)") - - -- add include directory - add_includedirs("$(projectdir)/src") - +${FAQ} diff --git a/xmake/templates/dlang/static/template.lua b/xmake/templates/dlang/static/template.lua index f05045e07..abfe91a4b 100644 --- a/xmake/templates/dlang/static/template.lua +++ b/xmake/templates/dlang/static/template.lua @@ -1,14 +1,2 @@ --- set name -set_name("static") - --- set description -set_description("The Static Library") - --- set project directory -set_projectdir("project") - --- add macros -add_macros("targetname", "$(targetname)") - --- add macro files -add_macrofiles("xmake.lua") +template("static") + add_configfiles("xmake.lua") |
