hikyuu2/hikyuu_cpp/unit_test/xmake.lua

85 lines
2.2 KiB
Lua

add_requires("doctest")
target("unit-test")
set_kind("binary")
set_default(false)
add_packages("fmt", "spdlog", "doctest", "mysql", "sqlite3")
add_includedirs("..")
if is_plat("windows") then
add_cxflags("-wd4267")
add_cxflags("-wd4251")
add_cxflags("-wd4244")
add_cxflags("-wd4805")
add_cxflags("-wd4566")
else
add_cxflags("-Wno-unused-variable", "-Wno-missing-braces")
add_cxflags("-Wno-sign-compare")
end
if is_plat("windows") and is_mode("release") then
add_defines("HKU_API=__declspec(dllimport)")
end
add_defines("TEST_ALL_IN_ONE")
add_deps("hikyuu")
if is_plat("linux") or is_plat("macosx") then
add_links("boost_unit_test_framework")
add_links("boost_filesystem")
add_links("boost_serialization")
add_links("sqlite3")
add_shflags("-Wl,-rpath=$ORIGIN", "-Wl,-rpath=$ORIGIN/../lib")
end
if is_plat("macosx") then
add_includedirs("/usr/local/opt/mysql-client/include")
add_linkdirs("/usr/local/opt/mysql-client/lib")
end
-- add files
add_files("**.cpp")
target_end()
target("small-test")
set_kind("binary")
set_default(false)
add_packages("fmt", "spdlog", "doctest", "mysql", "sqlite3")
add_includedirs("..")
--add_defines("BOOST_TEST_DYN_LINK")
if is_plat("windows") then
add_cxflags("-wd4267")
add_cxflags("-wd4251")
add_cxflags("-wd4244")
add_cxflags("-wd4805")
add_cxflags("-wd4566")
else
add_cxflags("-Wno-unused-variable", "-Wno-missing-braces")
add_cxflags("-Wno-sign-compare")
end
if is_plat("windows") and is_mode("release") then
add_defines("HKU_API=__declspec(dllimport)")
end
add_defines("TEST_ALL_IN_ONE")
add_deps("hikyuu")
if is_plat("linux") or is_plat("macosx") then
add_links("boost_unit_test_framework")
add_links("boost_filesystem")
add_shflags("-Wl,-rpath=$ORIGIN", "-Wl,-rpath=$ORIGIN/../lib")
end
-- add files
add_files("./hikyuu/hikyuu/**.cpp");
add_files("./hikyuu/test_main.cpp")
target_end()