hikyuu2/hikyuu_cpp/hikyuu/xmake.lua

87 lines
2.7 KiB
Lua
Raw Normal View History

target("hikyuu")
2020-04-03 02:05:27 +08:00
if is_mode("debug") then
set_kind("static")
else
set_kind("shared")
end
add_packages("fmt", "spdlog")
2019-06-04 23:13:32 +08:00
add_includedirs("..")
-- set version for release
set_configdir("./")
add_configfiles("$(projectdir)/config.h.in")
add_configfiles("$(projectdir)/version.h.in")
2018-09-19 02:45:50 +08:00
if is_plat("windows") then
add_cxflags("-wd4819")
add_cxflags("-wd4251") --template dll export warning
add_cxflags("-wd4267")
add_cxflags("-wd4834") --C++17 discarding return value of function with 'nodiscard' attribute
add_cxflags("-wd4996")
add_cxflags("-wd4244") --discable double to int
2019-09-29 00:35:19 +08:00
add_cxflags("-wd4566")
else
add_rpathdirs("$ORIGIN")
add_cxflags("-Wno-sign-compare", "-Wno-missing-braces")
end
if is_plat("windows") then
add_defines("SQLITE_API=__declspec(dllimport)")
add_defines("HKU_API=__declspec(dllexport)")
2019-06-04 23:13:32 +08:00
add_includedirs("../../hikyuu_extern_libs/src/sqlite3")
add_deps("sqlite3")
2020-03-01 01:24:55 +08:00
if is_mode("release") then
add_packages("hdf5")
else
add_packages("hdf5_D")
end
add_packages("mysql")
2018-09-19 02:45:50 +08:00
end
if is_plat("linux") then
add_includedirs("/usr/include/hdf5")
add_includedirs("/usr/include/hdf5/serial")
if is_arch("x86_64") then
2018-09-13 22:08:09 +08:00
add_linkdirs("/usr/lib/x86_64-linux-gnu")
2018-09-15 02:52:35 +08:00
add_linkdirs("/usr/lib/x86_64-linux-gnu/hdf5/serial")
2018-09-13 22:08:09 +08:00
end
2018-09-19 02:45:50 +08:00
end
if is_plat("macosx") then
2018-09-20 02:43:03 +08:00
--add_linkdirs("/usr/local/opt/libiconv/lib")
2018-09-19 02:45:50 +08:00
add_links("iconv")
add_includedirs("/usr/local/opt/hdf5/include")
add_linkdirs("/usr/local/opt/hdf5/lib")
add_includedirs("/usr/local/opt/mysql-client/include")
add_linkdirs("/usr/local/opt/mysql-client/lib")
end
2018-09-19 23:13:55 +08:00
if is_plat("linux") or is_plat("macosx") then
add_links("sqlite3")
2018-09-13 22:42:36 +08:00
add_links("hdf5")
add_links("hdf5_hl")
add_links("hdf5_cpp")
add_links("mysqlclient")
add_links("boost_date_time")
add_links("boost_filesystem")
add_links("boost_serialization")
add_links("boost_system")
end
-- add files
add_files("./**.cpp")
2019-06-04 23:13:32 +08:00
add_headerfiles("../(hikyuu/**.h)|**doc.h")
2018-09-09 16:43:04 +08:00
on_load(function(target)
2018-09-15 15:31:06 +08:00
assert(os.getenv("BOOST_ROOT"), [[Missing environment variable: BOOST_ROOT
You need to specify where the boost headers is via the BOOST_ROOT variable!]])
assert(os.getenv("BOOST_ROOT"), [[Missing environment variable: BOOST_LIB
You need to specify where the boost library is via the BOOST_LIB variable!]])
2018-09-09 16:43:04 +08:00
end)
2018-09-07 02:06:06 +08:00
target_end()