2018-08-19 16:51:10 +08:00
|
|
|
target("hikyuu")
|
|
|
|
set_kind("shared")
|
2018-08-26 18:47:06 +08:00
|
|
|
|
2018-09-10 02:21:19 +08:00
|
|
|
-- set version for release
|
|
|
|
set_config_header("version.h", {prefix = "HKU"})
|
2018-08-26 18:47:06 +08:00
|
|
|
|
2018-08-19 16:51:10 +08:00
|
|
|
if is_plat("windows") then
|
2018-08-26 18:47:06 +08:00
|
|
|
add_cxflags("-wd4819")
|
|
|
|
add_cxflags("-wd4251") --template dll export warning
|
2018-08-19 16:51:10 +08:00
|
|
|
add_cxflags("-wd4267")
|
|
|
|
add_cxflags("-wd4834") --C++17 discarding return value of function with 'nodiscard' attribute
|
|
|
|
add_cxflags("-wd4996")
|
2018-08-26 18:47:06 +08:00
|
|
|
add_cxflags("-wd4244") --discable double to int
|
2018-09-04 01:41:04 +08:00
|
|
|
else
|
2018-09-15 03:35:04 +08:00
|
|
|
add_rpathdirs("$ORIGIN")
|
|
|
|
add_cxflags("-Wno-sign-compare")
|
2018-08-19 16:51:10 +08:00
|
|
|
end
|
2018-09-04 01:41:04 +08:00
|
|
|
|
|
|
|
add_deps("hikyuu_utils")
|
2018-08-19 16:51:10 +08:00
|
|
|
|
|
|
|
if is_plat("windows") then
|
|
|
|
add_defines("SQLITE_API=__declspec(dllimport)")
|
|
|
|
add_defines("HKU_API=__declspec(dllexport)")
|
|
|
|
add_defines("PY_VERSION_HEX=0x03000000")
|
|
|
|
end
|
|
|
|
|
|
|
|
if is_plat("windows") then
|
|
|
|
add_deps("sqlite3")
|
|
|
|
add_packages("hdf5")
|
|
|
|
add_packages("mysql")
|
|
|
|
else
|
2018-09-13 22:08:09 +08:00
|
|
|
if is_arch("x86_64") then
|
|
|
|
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
|
|
|
|
add_includedirs("/usr/include/hdf5")
|
|
|
|
add_includedirs("/usr/include/hdf5/serial")
|
2018-08-19 16:51:10 +08:00
|
|
|
add_links("sqlite3")
|
2018-09-13 22:42:36 +08:00
|
|
|
add_links("hdf5")
|
|
|
|
add_links("hdf5_hl")
|
2018-08-19 16:51:10 +08:00
|
|
|
add_links("hdf5_cpp")
|
2018-09-04 01:41:04 +08:00
|
|
|
add_links("mysqlclient")
|
|
|
|
add_links("boost_date_time")
|
|
|
|
add_links("boost_filesystem")
|
|
|
|
add_links("boost_serialization")
|
|
|
|
add_links("boost_system")
|
2018-08-19 16:51:10 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
-- add files
|
|
|
|
add_files("./**.cpp")
|
|
|
|
|
|
|
|
add_headers("../(hikyuu/**.h)|**doc.h")
|
2018-09-09 16:43:04 +08:00
|
|
|
|
|
|
|
on_load(function(target)
|
|
|
|
local boostroot = val("env BOOST_ROOT")
|
|
|
|
if boostroot == "" then
|
|
|
|
local info = "Missing environment variable: BOOST_ROOT\n"
|
|
|
|
local desc = "You need to specify where the boost headers is via the BOOST_ROOT variable!"
|
|
|
|
raise(info..desc)
|
|
|
|
end
|
|
|
|
local boostlib = val("env BOOST_LIB")
|
|
|
|
if boostlib == "" then
|
|
|
|
local info = "Missing environment variable: BOOST_LIB\n"
|
|
|
|
local desc = "You need to specify where the boost library is via the BOOST_LIB variable!"
|
|
|
|
raise(info..desc)
|
|
|
|
end
|
|
|
|
end)
|
2018-08-19 16:51:10 +08:00
|
|
|
|
2018-09-07 02:06:06 +08:00
|
|
|
target_end()
|