1 Star 0 Fork 357

Joki.Zhu/tbox

forked from tboox/tbox 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
xmake.lua 2.17 KB
一键复制 编辑 原始数据 按行查看 历史
ruki 提交于 2020-04-02 22:54 . update tbox
-- project
set_project("tbox")
-- set xmake minimum version
set_xmakever("2.3.2")
-- set project version
set_version("1.6.5", {build = "%Y%m%d%H%M"})
-- set warning all as error
set_warnings("all", "error")
-- set language: c99
stdc = "c99"
set_languages(stdc)
-- add defines to config.h
set_configvar("_GNU_SOURCE", 1)
set_configvar("_REENTRANT", 1)
-- disable some compiler errors
add_cxflags("-Wno-error=deprecated-declarations", "-fno-strict-aliasing", "-Wno-error=expansion-to-defined")
add_mxflags("-Wno-error=deprecated-declarations", "-fno-strict-aliasing", "-Wno-error=expansion-to-defined")
-- add build modes
add_rules("mode.release", "mode.debug", "mode.profile", "mode.coverage")-- TODO, "mode.valgrind", "mode.asan", "mode.tsan", "mode.ubsan") -- for xmake v2.3.3
if is_mode("debug") then
add_defines("__tb_debug__")
end
if is_mode("valgrind") then
add_defines("__tb_valgrind__")
end
if is_mode("asan") then
add_defines("__tb_sanitize_address__")
end
if is_mode("tsan") then
add_defines("__tb_sanitize_thread__")
end
-- small or micro?
if has_config("small", "micro") then
add_defines("__tb_small__")
set_configvar("TB_CONFIG_SMALL", 1)
if is_mode("release", "profile") then
set_optimize("smallest")
end
add_cxflags("-fno-stack-protector")
end
-- for the windows platform (msvc)
if is_plat("windows") then
-- add some defines only for windows
add_defines("NOCRYPT", "NOGDI")
-- the release mode
if is_mode("release") then
-- link libcmt.lib
add_cxflags("-MT")
-- the debug mode
elseif is_mode("debug") then
-- enable some checkers
add_cxflags("-Gs", "-RTC1")
-- link libcmtd.lib
add_cxflags("-MTd")
end
-- no msvcrt.lib
add_ldflags("-nodefaultlib:msvcrt.lib")
add_syslinks("ws2_32")
elseif is_plat("android") then
add_syslinks("m", "c")
elseif is_plat("mingw", "msys", "cygwin") then
add_syslinks("ws2_32", "pthread", "m")
else
add_syslinks("pthread", "dl", "m", "c")
end
-- enable backtrace symbols for linux
if is_plat("linux") and is_mode("debug") then
add_ldflags("-rdynamic")
end
-- include project sources
includes("src")
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/superjoki/tbox.git
git@gitee.com:superjoki/tbox.git
superjoki
tbox
tbox
master

搜索帮助