improve building flags

This commit is contained in:
ruki
2018-11-22 22:43:43 +08:00
parent cbc0c42be9
commit 02df7c9384
3 changed files with 26 additions and 46 deletions

View File

@@ -1,32 +1,5 @@
-- add target target("ltui")
target("lcurses")
-- only make objects -- add source files
set_kind("object")
-- add deps
if is_plat("windows") then
add_deps("pdcurses")
end
-- add the common source files
add_files("lcurses.c") add_files("lcurses.c")
-- add packages
if has_config("luajit") then
add_defines("LUAJIT")
add_packages("luajit")
else
add_packages("lua")
end
-- add links
if is_plat("windows") then
add_defines("PDCURSES")
add_includedirs("../pdcurses")
else
add_links("curses")
end
-- set languages
set_languages("c89")

View File

@@ -1,17 +1,8 @@
-- add target target("ltui")
target("pdcurses")
-- only make objects -- add source files
set_kind("object")
-- add the common source files
add_files("**.c") add_files("**.c")
-- add include directories
add_includedirs(".")
-- add defines -- add defines
add_defines("PDC_WIDE") add_defines("PDC_WIDE")
-- set languages
set_languages("c89")

View File

@@ -38,9 +38,9 @@ option_end()
-- add requires -- add requires
if has_config("luajit") then if has_config("luajit") then
add_requires("luajit", {nolink = true}) add_requires("luajit", {nolink = not is_plat("windows")})
else else
add_requires("lua", {nolink = true}) add_requires("lua", {nolink = not is_plat("windows")})
end end
-- add target -- add target
@@ -49,12 +49,28 @@ target("ltui")
-- make as a shared library -- make as a shared library
set_kind("shared") set_kind("shared")
-- add deps
add_deps("lcurses")
-- set target directory -- set target directory
set_targetdir("$(buildir)") set_targetdir("$(buildir)")
-- set languages
set_languages("c89")
-- add packages
if has_config("luajit") then
add_defines("LUAJIT")
add_packages("luajit")
else
add_packages("lua")
end
-- add links
if is_plat("windows") then
add_defines("PDCURSES")
add_includedirs("pdcurses")
else
add_links("curses")
end
-- dynamic lookup liblua symbols -- dynamic lookup liblua symbols
if is_plat("macosx") then if is_plat("macosx") then
add_shflags("-undefined dynamic_lookup") add_shflags("-undefined dynamic_lookup")