2018-09-09 17:45:22 +08:00
|
|
|
option("with-unit-test")
|
2018-09-09 16:43:04 +08:00
|
|
|
set_default(false)
|
|
|
|
set_showmenu(true)
|
|
|
|
set_category("hikyuu")
|
|
|
|
set_description("Complie with unit-test")
|
|
|
|
option_end()
|
|
|
|
|
2018-09-04 01:41:04 +08:00
|
|
|
target("unit-test")
|
2018-09-12 01:14:16 +08:00
|
|
|
if has_config("with-unit-test") then
|
2018-09-09 16:43:04 +08:00
|
|
|
set_kind("binary")
|
|
|
|
else
|
|
|
|
set_kind("phony")
|
|
|
|
end
|
2018-08-19 16:51:10 +08:00
|
|
|
|
|
|
|
if is_plat("windows") then
|
|
|
|
add_cxflags("-wd4267")
|
2018-08-21 01:56:29 +08:00
|
|
|
add_cxflags("-wd4251")
|
2018-08-26 18:47:06 +08:00
|
|
|
add_cxflags("-wd4244")
|
|
|
|
add_cxflags("-wd4805")
|
2018-09-04 01:41:04 +08:00
|
|
|
else
|
|
|
|
add_cxflags("-Wno-unused-variable")
|
|
|
|
add_cxflags("-Wno-sign-compare")
|
2018-08-19 16:51:10 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
if is_plat("windows") then
|
|
|
|
add_defines("HKU_API=__declspec(dllimport)")
|
|
|
|
end
|
|
|
|
|
|
|
|
add_defines("PY_VERSION_HEX=0x03000000")
|
|
|
|
add_defines("TEST_ALL_IN_ONE")
|
|
|
|
|
|
|
|
add_deps("hikyuu")
|
|
|
|
|
2018-09-19 02:45:50 +08:00
|
|
|
if is_plat("linux") or is_plat("macosx") then
|
2018-09-04 01:41:04 +08:00
|
|
|
add_links("boost_unit_test_framework")
|
2018-09-07 02:06:06 +08:00
|
|
|
--add_links("boost_system")
|
|
|
|
add_shflags("-Wl,-rpath=$ORIGIN", "-Wl,-rpath=$ORIGIN/../lib")
|
2018-09-04 01:41:04 +08:00
|
|
|
end
|
|
|
|
|
2018-08-19 16:51:10 +08:00
|
|
|
-- add files
|
|
|
|
add_files("**.cpp")
|
2018-09-12 01:14:16 +08:00
|
|
|
|
2018-09-07 02:06:06 +08:00
|
|
|
target_end()
|