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("lcurses")
target("ltui")
-- only make objects
set_kind("object")
-- add deps
if is_plat("windows") then
add_deps("pdcurses")
end
-- add the common source files
-- add source files
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("pdcurses")
target("ltui")
-- only make objects
set_kind("object")
-- add the common source files
-- add source files
add_files("**.c")
-- add include directories
add_includedirs(".")
-- add defines
add_defines("PDC_WIDE")
-- set languages
set_languages("c89")

View File

@@ -38,9 +38,9 @@ option_end()
-- add requires
if has_config("luajit") then
add_requires("luajit", {nolink = true})
add_requires("luajit", {nolink = not is_plat("windows")})
else
add_requires("lua", {nolink = true})
add_requires("lua", {nolink = not is_plat("windows")})
end
-- add target
@@ -49,12 +49,28 @@ target("ltui")
-- make as a shared library
set_kind("shared")
-- add deps
add_deps("lcurses")
-- set target directory
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
if is_plat("macosx") then
add_shflags("-undefined dynamic_lookup")