开源中国 2018 年度最后一场技术盛会邀你来约~错过就要等明年啦!点此立即预约

GVPtboox / tboxC

指数
0
Watch 140 Star 312 Fork 95
加入码云
与超过 300 万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
跨平台的c开发库,提供asio、stream、容器、算法、xml/json/plist解析、数据库等常用模块 展开 收起

http://www.tboox.org

  • C 81.3%
  • GAP 9.1%
  • C++ 6.9%
  • Assembly 1.5%
  • Objective-C 0.8%
  • Other 0.4%
xmake.lua 3.21 KB
一键复制 编辑 Web IDE 原始数据 按行查看 历史
ruki 提交于 2018-11-24 22:41 . improve xmake.lua
-- project
set_project("tbox")
-- version
set_version("1.6.3")
set_xmakever("2.2.2")
-- set warning all as error
set_warnings("all", "error")
-- set language: c99, c++11
set_languages("c99", "cxx11")
-- add defines to config.h
add_defines_h("$(prefix)_OS_$(os:upper)")
add_defines_h("_GNU_SOURCE=1", "_REENTRANT")
-- disable some compiler errors
add_cxflags("-Wno-error=deprecated-declarations", "-fno-strict-aliasing")
add_mxflags("-Wno-error=deprecated-declarations", "-fno-strict-aliasing")
-- the debug, coverage, valgrind or sanitize-address/thread mode
if is_mode("debug", "coverage", "valgrind", "asan", "tsan") then
-- enable the debug symbols
set_symbols("debug")
-- disable optimization
set_optimize("none")
-- add defines for debug
if is_mode("debug") then
add_defines("__tb_debug__")
end
-- add defines for valgrind
if is_mode("valgrind") then
add_defines("__tb_valgrind__")
end
-- attempt to enable sanitize-address
if is_mode("asan") then
add_cxflags("-fsanitize=address", "-ftrapv")
add_mxflags("-fsanitize=address", "-ftrapv")
add_ldflags("-fsanitize=address")
add_defines("__tb_sanitize_address__")
end
-- attempt to enable sanitize-thread
if is_mode("tsan") then
add_cxflags("-fsanitize=thread")
add_mxflags("-fsanitize=thread")
add_ldflags("-fsanitize=thread")
add_defines("__tb_sanitize_thread__")
end
-- enable coverage
if is_mode("coverage") then
add_cxflags("--coverage")
add_mxflags("--coverage")
add_ldflags("--coverage")
end
end
-- the release, profile mode
if is_mode("release", "profile") then
-- the release mode
if is_mode("release") then
-- set the symbols visibility: hidden
set_symbols("hidden")
-- strip all symbols
set_strip("all")
-- the profile mode
else
-- enable the debug symbols
set_symbols("debug")
-- enable gprof
add_cxflags("-pg")
add_ldflags("-pg")
end
-- small or micro?
if has_config("small", "micro") then
set_optimize("smallest")
else
set_optimize("fastest")
end
-- disable stack protector for micro mode
if has_config("micro") then
add_cxflags("-fno-stack-protector")
end
end
-- small or micro?
if has_config("small", "micro") then
-- add defines for small
add_defines("__tb_small__")
-- add defines to config.h
add_defines_h("$(prefix)_SMALL")
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")
else
add_syslinks("pthread", "dl", "m", "c")
end
-- include project sources
includes("src")

评论 ( 0 )

你可以在登录后,发表评论

搜索帮助