summaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
authorruki <[email protected]>2020-04-22 00:48:39 +0800
committerruki <[email protected]>2020-04-21 22:51:59 +0800
commit93517f4cdc94a028399db7d642d7332338cc8363 (patch)
tree36415a1c67860f82e2a5df38ef42bd0f4df331cf /core/src
parent4dbc3cce61a2d848e92d7d9327fb0f2b81d36d57 (diff)
improve core/xmake.lua
Diffstat (limited to 'core/src')
-rw-r--r--core/src/lcurses/xmake.lua10
-rw-r--r--core/src/pdcurses/xmake.lua5
-rw-r--r--core/src/xmake/xmake.lua11
3 files changed, 17 insertions, 9 deletions
diff --git a/core/src/lcurses/xmake.lua b/core/src/lcurses/xmake.lua
index c4714c316..771bf8111 100644
--- a/core/src/lcurses/xmake.lua
+++ b/core/src/lcurses/xmake.lua
@@ -1,12 +1,17 @@
-- add target
target("lcurses")
+ -- enable this target?
+ if not has_config("curses") and not has_config("pdcurses") then
+ set_default(false)
+ end
+
-- make as a static library
set_kind("static")
-- add deps
add_deps("luajit")
- if is_plat("windows") then
+ if is_plat("windows") and has_config("pdcurses") then
add_deps("pdcurses")
end
@@ -15,8 +20,7 @@ target("lcurses")
-- add options
if is_plat("windows") then
- add_defines("PDCURSES", "XM_CONFIG_API_HAVE_CURSES")
- add_includedirs("../pdcurses")
+ add_options("pdcurses")
else
add_options("curses")
end
diff --git a/core/src/pdcurses/xmake.lua b/core/src/pdcurses/xmake.lua
index ecbeb62e0..4fd2bb96d 100644
--- a/core/src/pdcurses/xmake.lua
+++ b/core/src/pdcurses/xmake.lua
@@ -1,6 +1,11 @@
-- add target
target("pdcurses")
+ -- enable this target
+ if not has_config("pdcurses") then
+ set_default(false)
+ end
+
-- make as a static library
set_kind("static")
diff --git a/core/src/xmake/xmake.lua b/core/src/xmake/xmake.lua
index df9bbe11d..d85b2802f 100644
--- a/core/src/xmake/xmake.lua
+++ b/core/src/xmake/xmake.lua
@@ -5,7 +5,10 @@ target("xmake")
set_kind("static")
-- add deps
- add_deps("lcurses", "sv", "luajit", "tbox")
+ if has_config("curses") or has_config("pdcurses") then
+ add_deps("lcurses")
+ end
+ add_deps("sv", "luajit", "tbox")
-- add defines
add_defines("__tb_prefix__=\"xmake\"")
@@ -32,12 +35,8 @@ target("xmake")
add_files("winos/*.c")
end
- -- add readline
+ -- add options
add_options("readline")
-
- if is_plat("windows") or has_config("curses") then
- add_defines("XM_CONFIG_API_HAVE_CURSES")
- end
if is_plat("windows") then
add_defines("UNICODE", "_UNICODE")
end