diff options
| author | ruki <[email protected]> | 2016-02-17 20:35:16 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2016-02-17 20:35:16 +0800 |
| commit | d316be4334127336822e8daeb8a45d2ffe0bdde7 (patch) | |
| tree | cb517e6a91d64073d67d1870edf72356299da84c /tests/console | |
| parent | 1015eb5af840daeb67af07ba359a18ee5d5215c6 (diff) | |
modify interfaces for xmake.lua
Diffstat (limited to 'tests/console')
| -rw-r--r-- | tests/console/src/demo/xmake.lua | 24 | ||||
| -rw-r--r-- | tests/console/xmake.lua | 28 |
2 files changed, 26 insertions, 26 deletions
diff --git a/tests/console/src/demo/xmake.lua b/tests/console/src/demo/xmake.lua index 6585054be..912a24a69 100644 --- a/tests/console/src/demo/xmake.lua +++ b/tests/console/src/demo/xmake.lua @@ -1,5 +1,5 @@ -def_target("demo_c") +target("demo_c") set_kind("binary") add_deps("hello1") add_files("*.c") @@ -8,13 +8,13 @@ def_target("demo_c") add_includedirs("$(buildir)") add_cflags("-DHELLO1") - if modes("release") then add_defines("NDEBUG") end - if options("option1") then add_defines("OPTION1") end - if options("option2") then add_defines("OPTION2") end - if options("option3") then add_defines("OPTION3") end - if options("option4") then add_defines("OPTION4") end + if is_mode("release") then add_defines("NDEBUG") end + if is_option("option1") then add_defines("OPTION1") end + if is_option("option2") then add_defines("OPTION2") end + if is_option("option3") then add_defines("OPTION3") end + if is_option("option4") then add_defines("OPTION4") end -def_target("demo_cpp") +target("demo_cpp") set_kind("binary") add_deps("hello2") add_files("*.cpp") @@ -29,9 +29,9 @@ def_target("demo_cpp") return 1 end) - if plats("macosx", "ios") then + if is_plat("macosx", "ios") then - def_target("demo_objc") + target("demo_objc") set_kind("binary") add_deps("hello3") add_files("*.m") @@ -40,18 +40,18 @@ def_target("demo_cpp") add_includedirs("$(buildir)/inc") add_mflags("-DHELLO3", "-DPLAT=\"macosx\"", "-DARCH='armv7, arm64'") - def_target("demo_objcpp") + target("demo_objcpp") set_kind("binary") add_deps("hello3") add_files("*.mm") add_mxflags("-DHELLO3") add_ldflags("-L$(buildir)/lib", "-lhello3", "-lhello3") - if plats("ios") then + if is_plat("ios") then add_ldflags("-framework Cocoa", "-framework IOKit", "-framework CoreFoundation") end end -def_target("demo_swift") +target("demo_swift") set_kind("binary") add_files("*.swift") diff --git a/tests/console/xmake.lua b/tests/console/xmake.lua index b4cf57d58..74ebb7574 100644 --- a/tests/console/xmake.lua +++ b/tests/console/xmake.lua @@ -1,14 +1,14 @@ set_version("1.0.1") set_config_h("$(buildir)/demo.h") -if modes("debug") then +if is_mode("debug") then set_symbols("debug") set_warnings("all") set_optimize("none") add_cxflags("-fsanitize=address", "-ftrapv") end -if modes("release") then +if is_mode("release") then set_strip("all") set_symbols("hidden") add_cflags("-Wno-error=deprecated-declarations") @@ -17,23 +17,23 @@ if modes("release") then add_vectorexts("sse2", "ssse3", "mmx") end -if modes("profile") then +if is_mode("profile") then set_symbols("debug") set_warnings("none") set_optimize("fastest") end -if archs("x86", "x64") then +if is_arch("x86", "x64") then add_defines("ARCH=\"$(arch)\"", "PLAT=$(plat)", "MODE=$(mode)", "HOST=$(host)") end -def_option("option1") +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.") -def_option("option2") +option("option2") set_option_enable(false) set_option_showmenu(true) add_option_defines_h_if_ok("OPTION2_ENABLE") @@ -41,7 +41,7 @@ def_option("option2") add_option_includedirs("src/hello1") set_option_description("The option for finding includes.") -def_option("option3") +option("option3") set_option_enable(false) set_option_showmenu(true) add_option_defines_h_if_ok("OPTION3_ENABLE") @@ -49,26 +49,26 @@ def_option("option3") add_option_linkdirs("$(buildir)") set_option_description("The option for finding links.") -def_option("option4") +option("option4") set_option_enable(false) set_option_showmenu(true) add_option_defines_h_if_ok("OPTION4_ENABLE") set_option_description("The option for finding interfaces.") - if not plats("windows") then + if not is_plat("windows") then add_option_links("z", "sqlite3") add_option_cfuncs("sqlite3_open") add_option_cincludes("stdio.h", "sqlite3.h") end -def_target("hello1") +target("hello1") set_kind("static") add_files("src/hello1/*.c") -def_target("hello2") +target("hello2") set_kind("shared") add_files("$(projectdir)/src/hello2/*.c") -def_target("hello3") +target("hello3") set_kind("static") add_files("src/hello3/*.c") add_headers("src/(hello3/*.h)") @@ -76,13 +76,13 @@ def_target("hello3") set_targetdir("$(buildir)/lib") set_objectdir("$(buildir)/obj") -def_target("hello4") +target("hello4") set_kind("static") add_deps("hello1", "hello2") add_files("$(buildir)/.objs/hello1/**.o") add_files("$(buildir)/.objs/hello2/**.obj") -def_target("hello5") +target("hello5") set_kind("static") add_deps("hello4", "hello1") add_files("$(buildir)/hello1.lib") |
