diff --git a/hikyuu_extern_libs/packages/h/hdf5/xmake.lua b/hikyuu_extern_libs/packages/h/hdf5/xmake.lua new file mode 100644 index 000000000..fdec85456 --- /dev/null +++ b/hikyuu_extern_libs/packages/h/hdf5/xmake.lua @@ -0,0 +1,21 @@ +package("hdf5") + + set_homepage("https://www.hdfgroup.org/solutions/hdf5/") + set_description("High-performance data management and storage suite") + set_license("BSD-3-Clause") + + if is_plat("windows") then + add_urls("https://gitee.com/fasiondog/hikyuu/attach_files/935347/download/hdf5-$(version)-win-x64.zip") + add_versions("1.10.4", "253b23baada1d9c86cb4424595eba366b6844c384a5e0aafebf0893a1148f25f") + end + + on_load(function (package) + package:add("defines", "H5_BUILT_AS_DYNAMIC_LIB") + end) + + on_install("windows", function (package) + os.cp("include", package:installdir()) + os.cp("lib", package:installdir()) + os.cp("bin", package:installdir()) + end) + diff --git a/hikyuu_extern_libs/packages/h/hdf5_D/xmake.lua b/hikyuu_extern_libs/packages/h/hdf5_D/xmake.lua new file mode 100644 index 000000000..e1fbefc8d --- /dev/null +++ b/hikyuu_extern_libs/packages/h/hdf5_D/xmake.lua @@ -0,0 +1,21 @@ +package("hdf5_D") + + set_homepage("https://www.hdfgroup.org/solutions/hdf5/") + set_description("High-performance data management and storage suite") + set_license("BSD-3-Clause") + + if is_plat("windows") then + add_urls("https://gitee.com/fasiondog/hikyuu/attach_files/935348/download/hdf5_D-$(version)-win-x64.zip") + add_versions("1.10.4", "5b1bd27e054f885bf9cac0beffcacbe180e251c5d8c12c0652a96055f2784b46") + end + + on_load("windows", function (package) + package:add("defines", "H5_BUILT_AS_DYNAMIC_LIB") + end) + + on_install("windows", function (package) + os.cp("include", package:installdir()) + os.cp("lib", package:installdir()) + os.cp("bin", package:installdir()) + end) + diff --git a/hikyuu_extern_libs/packages/m/mysql/xmake.lua b/hikyuu_extern_libs/packages/m/mysql/xmake.lua new file mode 100644 index 000000000..571fb4498 --- /dev/null +++ b/hikyuu_extern_libs/packages/m/mysql/xmake.lua @@ -0,0 +1,16 @@ +package("mysql") + + set_homepage("https://dev.mysql.com/doc/refman/5.7/en/") + set_description("Open source relational database management system.") + + if is_plat("windows") then + add_urls("https://gitee.com/fasiondog/hikyuu/attach_files/935339/download/mysql-$(version)-win-x64.zip") + add_versions("8.0.21", "de21694aa230a00b52b28babbce9bb150d990ba1f539edf8d193586dce3844ae") + end + + on_install("windows", function (package) + os.cp("include", package:installdir()) + os.cp("lib", package:installdir()) + os.cp("bin", package:installdir()) + end) + diff --git a/hikyuu_pywrap/xmake.lua b/hikyuu_pywrap/xmake.lua index a5946e1b7..c133b511b 100644 --- a/hikyuu_pywrap/xmake.lua +++ b/hikyuu_pywrap/xmake.lua @@ -110,8 +110,7 @@ target("core") local dst_dir = "$(projectdir)/hikyuu/cpp/" if is_plat("windows") then os.cp(target:targetdir() .. '/core.pyd', dst_dir) - os.cp(target:targetdir() .. '/hikyuu.dll', dst_dir) - os.cp(target:targetdir() .. '/sqlite3.dll', dst_dir) + os.cp(target:targetdir() .. '/*.dll', dst_dir) elseif is_plat("macosx") then os.cp(target:targetdir() .. '/core.so', dst_dir) os.cp(target:targetdir() .. '/libhikyuu.dylib', dst_dir) @@ -135,15 +134,6 @@ target("core") os.cp("$(env BOOST_LIB)/libboost_python3*.dylib", dst_dir) os.cp("$(env BOOST_LIB)/libboost_serialization*.dylib", dst_dir) os.cp("$(env BOOST_LIB)/libboost_system*.dylib", dst_dir) - - if is_plat("windows") then - if is_mode("release") then - os.cp("$(projectdir)/hikyuu_extern_libs/pkg/hdf5.pkg/lib/$(mode)/$(plat)/$(arch)/*.dll", dst_dir) - else - os.cp("$(projectdir)/hikyuu_extern_libs/pkg/hdf5_D.pkg/lib/$(mode)/$(plat)/$(arch)/*.dll", dst_dir) - end - os.cp("$(projectdir)/hikyuu_extern_libs/pkg/mysql.pkg/lib/$(mode)/$(plat)/$(arch)/*.dll", dst_dir) - end end) diff --git a/scripts/before_run.lua b/scripts/before_run.lua index 0cb41cec6..8c2d7496f 100644 --- a/scripts/before_run.lua +++ b/scripts/before_run.lua @@ -18,12 +18,6 @@ function main(target) if is_plat("windows") then os.cp("$(env BOOST_LIB)/boost_*.dll", "$(buildir)/$(mode)/$(plat)/$(arch)/lib/") - if is_mode("release") then - os.cp("$(projectdir)/hikyuu_extern_libs/pkg/hdf5.pkg/lib/$(mode)/$(plat)/$(arch)/*.dll","$(buildir)/$(mode)/$(plat)/$(arch)/lib/") - else - os.cp("$(projectdir)/hikyuu_extern_libs/pkg/hdf5_D.pkg/lib/$(mode)/$(plat)/$(arch)/*.*","$(buildir)/$(mode)/$(plat)/$(arch)/lib/") - end - os.cp("$(projectdir)/hikyuu_extern_libs/pkg/mysql.pkg/lib/$(mode)/$(plat)/$(arch)/*.dll", "$(buildir)/$(mode)/$(plat)/$(arch)/lib/") end --if is_plat("linux") then diff --git a/xmake.lua b/xmake.lua index cd5d8cc1a..e8812aede 100644 --- a/xmake.lua +++ b/xmake.lua @@ -41,6 +41,18 @@ set_languages("cxx17", "C99") add_plugindirs("./xmake_plugins") +local hdf5_version = "1.10.4" +local mysql_version = "8.0.21" +if is_plat("windows") then + add_repositories("project-repo hikyuu_extern_libs") + if is_mode("release") then + add_requires("hdf5 " .. hdf5_version) + else + add_requires("hdf5_D " .. hdf5_version) + end + add_requires("mysql " .. mysql_version) +end + add_requires("fmt", {system=false, configs = {header_only = true, vs_runtime = "MD"}}) add_requires("spdlog", {system=false, configs = {header_only = true, fmt_external=true, vs_runtime = "MD"}}) add_requires("flatbuffers", {system=false, configs = {vs_runtime="MD"}}) @@ -86,7 +98,6 @@ end -- for the windows platform (msvc) if is_plat("windows") then - add_packagedirs("./hikyuu_extern_libs/pkg") -- add some defines only for windows add_defines("NOCRYPT", "NOGDI") add_cxflags("-EHsc", "/Zc:__cplusplus", "/utf-8")