From 8e2eeeadd2da69bd4db3b73e7348a1ac92940ba1 Mon Sep 17 00:00:00 2001 From: star9029 Date: Sat, 8 Jun 2024 13:01:48 +0800 Subject: [PATCH 1/7] bmf: add package --- packages/b/backward-cpp/xmake.lua | 9 ++-- packages/b/bmf/xmake.lua | 89 +++++++++++++++++++++++++++++++ packages/d/dlpack/xmake.lua | 31 +++++++++++ packages/s/spdlog/xmake.lua | 3 ++ 4 files changed, 129 insertions(+), 3 deletions(-) create mode 100644 packages/b/bmf/xmake.lua create mode 100644 packages/d/dlpack/xmake.lua diff --git a/packages/b/backward-cpp/xmake.lua b/packages/b/backward-cpp/xmake.lua index 7bfdb784f69..76602249635 100644 --- a/packages/b/backward-cpp/xmake.lua +++ b/packages/b/backward-cpp/xmake.lua @@ -1,5 +1,5 @@ package("backward-cpp") - + set_kind("library", {headeronly = true}) set_homepage("https://github.com/bombela/backward-cpp") set_description("Backward is a beautiful stack trace pretty printer for C++.") set_license("MIT") @@ -33,11 +33,14 @@ package("backward-cpp") end local configs = {"-DBACKWARD_TESTS=OFF"} table.insert(configs, "-DBACKWARD_SHARED=" .. (package:config("shared") and "ON" or "OFF")) + if package:is_plat("windows") then + table.insert(configs, "-DCMAKE_COMPILE_PDB_OUTPUT_DIRECTORY=''") + end import("package.tools.cmake").install(package, configs) - os.mv(package:installdir("include/*.hpp"), package:installdir("include/backward")) + os.vcp(package:installdir("include/*.hpp"), package:installdir("include/backward")) + os.vcp(package:installdir("include/*.hpp"), package:installdir("lib/backward")) end) on_test(function (package) assert(package:has_cxxtypes("backward::SignalHandling", {configs = {languages = "c++11"}, includes = "backward/backward.hpp"})) end) - diff --git a/packages/b/bmf/xmake.lua b/packages/b/bmf/xmake.lua new file mode 100644 index 00000000000..c7886ac1f06 --- /dev/null +++ b/packages/b/bmf/xmake.lua @@ -0,0 +1,89 @@ +package("bmf") + set_homepage("https://babitmf.github.io/") + set_description("Cross-platform, customizable multimedia/video processing framework. With strong GPU acceleration, heterogeneous design, multi-language support, easy to use, multi-framework compatible and high performance, the framework is ideal for transcoding, AI inference, algorithm integration, live video streaming, and more.") + set_license("Apache-2.0") + + add_urls("https://github.com/BabitMF/bmf/archive/refs/tags/$(version).tar.gz", + "https://github.com/BabitMF/bmf.git") + + add_versions("v0.0.10", "9d24fc909a626730518dc8f9f4dc02d76345ea38445166b116b3f10ef9adb691") + + add_configs("breakpad", {description = "Enable build with breakpad support", default = false, type = "boolean"}) + add_configs("cuda", {description = "Enable CUDA support", default = false, type = "boolean"}) + add_configs("glog", {description = "Enable build with glog support", default = false, type = "boolean"}) + add_configs("ffmpeg", {description = "Enable build with ffmpeg support", default = false, type = "boolean"}) + add_configs("mobile", {description = "Enable build for mobile platform", default = false, type = "boolean"}) + + add_deps("cmake") + add_deps("nlohmann_json", {configs = {cmake = true}}) + add_deps("spdlog", {configs = {header_only = false}}) + add_deps("fmt <=8.0.0", "dlpack", "backward-cpp") + if is_plat("windows") then + add_deps("dlfcn-win32") + elseif is_plat("linux") then + add_syslinks("pthread") + end + + on_load(function (package) + if package:config("breakpad") then + package:add("deps", "breakpad") + end + if package:config("cuda") then + package:add("deps", "cuda") + end + if package:config("glog") then + package:add("deps", "glog") + end + if package:config("ffmpeg") then + package:add("deps", "ffmpeg") + end + end) + + on_install("!windows", function (package) + io.replace("cmake/dependencies.cmake", "find_package(pybind11 REQUIRED)", "", {plain = true}) + io.replace("bmf/hml/cmake/dependencies.cmake", "find_package(GTest REQUIRED)", "", {plain = true}) + io.replace("bmf/hml/cmake/dependencies.cmake", "add_library(gtest ALIAS GTest::gtest)", "", {plain = true}) + io.replace("bmf/hml/cmake/dependencies.cmake", "add_library(gtest_main ALIAS GTest::gtest_main)", "", {plain = true}) + io.replace("bmf/hml/cmake/dependencies.cmake", "find_package(benchmark REQUIRED)", "", {plain = true}) + -- io.replace("bmf/hml/src/core/logging.cpp", "backward.hpp", "backward/backward.hpp", {plain = true}) + + if package:is_plat("windows") then + for _, file in ipairs(os.files("bmf/**.cpp", "bmf/**.h")) do + io.replace(file, "#include ", "", {plain = true}) + end + end + + local configs = { + "-DBMF_LOCAL_DEPENDENCIES=OFF", + "-DBMF_ENABLE_PYTHON=OFF", + "-DBMF_ENABLE_TEST=OFF", + } + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + + local ver = package:version() + if ver then + table.insert(configs, "-DBMF_BUILD_VERSION=" .. ver) + end + + table.insert(configs, "-DBMF_ENABLE_BREAKPAD=" .. (package:config("breakpad") and "ON" or "OFF")) + table.insert(configs, "-DBMF_ENABLE_CUDA=" .. (package:config("cuda") and "ON" or "OFF")) + table.insert(configs, "-DBMF_ENABLE_GLOG=" .. (package:config("glog") and "ON" or "OFF")) + table.insert(configs, "-DBMF_ENABLE_FFMPEG=" .. (package:config("ffmpeg") and "ON" or "OFF")) + table.insert(configs, "-DBMF_ENABLE_MOBILE=" .. (package:config("mobile") and "ON" or "OFF")) + + local envs = import("package.tools.cmake").buildenvs(package) + if package:is_plat("windows") then + envs.SCRIPT_EXEC_MODE = "win" + end + import("package.tools.cmake").install(package, configs, {envs = envs}) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + AudioFrame x(); + } + ]]}, {configs = {languages = "c++11"}})) + end) diff --git a/packages/d/dlpack/xmake.lua b/packages/d/dlpack/xmake.lua new file mode 100644 index 00000000000..8810ba26c05 --- /dev/null +++ b/packages/d/dlpack/xmake.lua @@ -0,0 +1,31 @@ +package("dlpack") + set_homepage("https://dmlc.github.io/dlpack/latest") + set_description("common in-memory tensor structure ") + set_license("Apache-2.0") + + add_urls("https://github.com/dmlc/dlpack/archive/refs/tags/$(version).tar.gz", + "https://github.com/dmlc/dlpack.git") + + add_versions("v0.8", "cf965c26a5430ba4cc53d61963f288edddcd77443aa4c85ce722aaf1e2f29513") + + add_configs("contrib", {description = "Build in progress unstable libraries", default = false, type = "boolean"}) + + add_deps("cmake") + + on_load(function (package) + if not package:config("contrib") then + package:set("kind", "library", {headeronly = true}) + end + end) + + on_install(function (package) + local configs = {} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DBUILD_MOCK=" .. (package:config("contrib") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_ctypes("DLDevice", {includes = "dlpack/dlpack.h"})) + end) diff --git a/packages/s/spdlog/xmake.lua b/packages/s/spdlog/xmake.lua index 4077ddac733..b09c21ed779 100644 --- a/packages/s/spdlog/xmake.lua +++ b/packages/s/spdlog/xmake.lua @@ -74,6 +74,9 @@ package("spdlog") table.insert(configs, "-DSPDLOG_FMT_EXTERNAL_HO=" .. (package:config("fmt_external_ho") and "ON" or "OFF")) table.insert(configs, "-DSPDLOG_NO_EXCEPTIONS=" .. (package:config("noexcept") and "ON" or "OFF")) table.insert(configs, "-DSPDLOG_WCHAR_SUPPORT=" .. (package:config("wchar") and "ON" or "OFF")) + if package:is_plat("windows") then + table.insert(configs, "-DCMAKE_COMPILE_PDB_OUTPUT_DIRECTORY=''") + end import("package.tools.cmake").install(package, configs) end) From f763665ed2ab53b1cf07a297fff0bbe9d5e983cb Mon Sep 17 00:00:00 2001 From: star9029 Date: Tue, 23 Jul 2024 01:00:20 +0800 Subject: [PATCH 2/7] Revert "bmf: add package" This reverts commit 8e2eeeadd2da69bd4db3b73e7348a1ac92940ba1. --- packages/b/backward-cpp/xmake.lua | 9 ++-- packages/b/bmf/xmake.lua | 89 ------------------------------- packages/d/dlpack/xmake.lua | 31 ----------- packages/s/spdlog/xmake.lua | 3 -- 4 files changed, 3 insertions(+), 129 deletions(-) delete mode 100644 packages/b/bmf/xmake.lua delete mode 100644 packages/d/dlpack/xmake.lua diff --git a/packages/b/backward-cpp/xmake.lua b/packages/b/backward-cpp/xmake.lua index 76602249635..7bfdb784f69 100644 --- a/packages/b/backward-cpp/xmake.lua +++ b/packages/b/backward-cpp/xmake.lua @@ -1,5 +1,5 @@ package("backward-cpp") - set_kind("library", {headeronly = true}) + set_homepage("https://github.com/bombela/backward-cpp") set_description("Backward is a beautiful stack trace pretty printer for C++.") set_license("MIT") @@ -33,14 +33,11 @@ package("backward-cpp") end local configs = {"-DBACKWARD_TESTS=OFF"} table.insert(configs, "-DBACKWARD_SHARED=" .. (package:config("shared") and "ON" or "OFF")) - if package:is_plat("windows") then - table.insert(configs, "-DCMAKE_COMPILE_PDB_OUTPUT_DIRECTORY=''") - end import("package.tools.cmake").install(package, configs) - os.vcp(package:installdir("include/*.hpp"), package:installdir("include/backward")) - os.vcp(package:installdir("include/*.hpp"), package:installdir("lib/backward")) + os.mv(package:installdir("include/*.hpp"), package:installdir("include/backward")) end) on_test(function (package) assert(package:has_cxxtypes("backward::SignalHandling", {configs = {languages = "c++11"}, includes = "backward/backward.hpp"})) end) + diff --git a/packages/b/bmf/xmake.lua b/packages/b/bmf/xmake.lua deleted file mode 100644 index c7886ac1f06..00000000000 --- a/packages/b/bmf/xmake.lua +++ /dev/null @@ -1,89 +0,0 @@ -package("bmf") - set_homepage("https://babitmf.github.io/") - set_description("Cross-platform, customizable multimedia/video processing framework. With strong GPU acceleration, heterogeneous design, multi-language support, easy to use, multi-framework compatible and high performance, the framework is ideal for transcoding, AI inference, algorithm integration, live video streaming, and more.") - set_license("Apache-2.0") - - add_urls("https://github.com/BabitMF/bmf/archive/refs/tags/$(version).tar.gz", - "https://github.com/BabitMF/bmf.git") - - add_versions("v0.0.10", "9d24fc909a626730518dc8f9f4dc02d76345ea38445166b116b3f10ef9adb691") - - add_configs("breakpad", {description = "Enable build with breakpad support", default = false, type = "boolean"}) - add_configs("cuda", {description = "Enable CUDA support", default = false, type = "boolean"}) - add_configs("glog", {description = "Enable build with glog support", default = false, type = "boolean"}) - add_configs("ffmpeg", {description = "Enable build with ffmpeg support", default = false, type = "boolean"}) - add_configs("mobile", {description = "Enable build for mobile platform", default = false, type = "boolean"}) - - add_deps("cmake") - add_deps("nlohmann_json", {configs = {cmake = true}}) - add_deps("spdlog", {configs = {header_only = false}}) - add_deps("fmt <=8.0.0", "dlpack", "backward-cpp") - if is_plat("windows") then - add_deps("dlfcn-win32") - elseif is_plat("linux") then - add_syslinks("pthread") - end - - on_load(function (package) - if package:config("breakpad") then - package:add("deps", "breakpad") - end - if package:config("cuda") then - package:add("deps", "cuda") - end - if package:config("glog") then - package:add("deps", "glog") - end - if package:config("ffmpeg") then - package:add("deps", "ffmpeg") - end - end) - - on_install("!windows", function (package) - io.replace("cmake/dependencies.cmake", "find_package(pybind11 REQUIRED)", "", {plain = true}) - io.replace("bmf/hml/cmake/dependencies.cmake", "find_package(GTest REQUIRED)", "", {plain = true}) - io.replace("bmf/hml/cmake/dependencies.cmake", "add_library(gtest ALIAS GTest::gtest)", "", {plain = true}) - io.replace("bmf/hml/cmake/dependencies.cmake", "add_library(gtest_main ALIAS GTest::gtest_main)", "", {plain = true}) - io.replace("bmf/hml/cmake/dependencies.cmake", "find_package(benchmark REQUIRED)", "", {plain = true}) - -- io.replace("bmf/hml/src/core/logging.cpp", "backward.hpp", "backward/backward.hpp", {plain = true}) - - if package:is_plat("windows") then - for _, file in ipairs(os.files("bmf/**.cpp", "bmf/**.h")) do - io.replace(file, "#include ", "", {plain = true}) - end - end - - local configs = { - "-DBMF_LOCAL_DEPENDENCIES=OFF", - "-DBMF_ENABLE_PYTHON=OFF", - "-DBMF_ENABLE_TEST=OFF", - } - table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) - table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) - - local ver = package:version() - if ver then - table.insert(configs, "-DBMF_BUILD_VERSION=" .. ver) - end - - table.insert(configs, "-DBMF_ENABLE_BREAKPAD=" .. (package:config("breakpad") and "ON" or "OFF")) - table.insert(configs, "-DBMF_ENABLE_CUDA=" .. (package:config("cuda") and "ON" or "OFF")) - table.insert(configs, "-DBMF_ENABLE_GLOG=" .. (package:config("glog") and "ON" or "OFF")) - table.insert(configs, "-DBMF_ENABLE_FFMPEG=" .. (package:config("ffmpeg") and "ON" or "OFF")) - table.insert(configs, "-DBMF_ENABLE_MOBILE=" .. (package:config("mobile") and "ON" or "OFF")) - - local envs = import("package.tools.cmake").buildenvs(package) - if package:is_plat("windows") then - envs.SCRIPT_EXEC_MODE = "win" - end - import("package.tools.cmake").install(package, configs, {envs = envs}) - end) - - on_test(function (package) - assert(package:check_cxxsnippets({test = [[ - #include - void test() { - AudioFrame x(); - } - ]]}, {configs = {languages = "c++11"}})) - end) diff --git a/packages/d/dlpack/xmake.lua b/packages/d/dlpack/xmake.lua deleted file mode 100644 index 8810ba26c05..00000000000 --- a/packages/d/dlpack/xmake.lua +++ /dev/null @@ -1,31 +0,0 @@ -package("dlpack") - set_homepage("https://dmlc.github.io/dlpack/latest") - set_description("common in-memory tensor structure ") - set_license("Apache-2.0") - - add_urls("https://github.com/dmlc/dlpack/archive/refs/tags/$(version).tar.gz", - "https://github.com/dmlc/dlpack.git") - - add_versions("v0.8", "cf965c26a5430ba4cc53d61963f288edddcd77443aa4c85ce722aaf1e2f29513") - - add_configs("contrib", {description = "Build in progress unstable libraries", default = false, type = "boolean"}) - - add_deps("cmake") - - on_load(function (package) - if not package:config("contrib") then - package:set("kind", "library", {headeronly = true}) - end - end) - - on_install(function (package) - local configs = {} - table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) - table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) - table.insert(configs, "-DBUILD_MOCK=" .. (package:config("contrib") and "ON" or "OFF")) - import("package.tools.cmake").install(package, configs) - end) - - on_test(function (package) - assert(package:has_ctypes("DLDevice", {includes = "dlpack/dlpack.h"})) - end) diff --git a/packages/s/spdlog/xmake.lua b/packages/s/spdlog/xmake.lua index b09c21ed779..4077ddac733 100644 --- a/packages/s/spdlog/xmake.lua +++ b/packages/s/spdlog/xmake.lua @@ -74,9 +74,6 @@ package("spdlog") table.insert(configs, "-DSPDLOG_FMT_EXTERNAL_HO=" .. (package:config("fmt_external_ho") and "ON" or "OFF")) table.insert(configs, "-DSPDLOG_NO_EXCEPTIONS=" .. (package:config("noexcept") and "ON" or "OFF")) table.insert(configs, "-DSPDLOG_WCHAR_SUPPORT=" .. (package:config("wchar") and "ON" or "OFF")) - if package:is_plat("windows") then - table.insert(configs, "-DCMAKE_COMPILE_PDB_OUTPUT_DIRECTORY=''") - end import("package.tools.cmake").install(package, configs) end) From 5592dd1a39f79da87dc9779b5c1f874b2c858f97 Mon Sep 17 00:00:00 2001 From: star9029 Date: Tue, 23 Jul 2024 01:03:32 +0800 Subject: [PATCH 3/7] try port --- packages/b/bmf/xmake.lua | 86 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 packages/b/bmf/xmake.lua diff --git a/packages/b/bmf/xmake.lua b/packages/b/bmf/xmake.lua new file mode 100644 index 00000000000..ae5426df0f5 --- /dev/null +++ b/packages/b/bmf/xmake.lua @@ -0,0 +1,86 @@ +package("bmf") + set_homepage("https://babitmf.github.io/") + set_description("Cross-platform, customizable multimedia/video processing framework. With strong GPU acceleration, heterogeneous design, multi-language support, easy to use, multi-framework compatible and high performance, the framework is ideal for transcoding, AI inference, algorithm integration, live video streaming, and more.") + set_license("Apache-2.0") + + add_urls("https://github.com/star-hengxing/bmf/archive/refs/heads/windows-support.zip") + add_versions("v0.0.10", "36fdcf8976a577ab2fb547e69f237b639cd4b27cf0c41e490b6dcecf868f5590") + + add_configs("breakpad", {description = "Enable build with breakpad support", default = false, type = "boolean"}) + add_configs("cuda", {description = "Enable CUDA support", default = false, type = "boolean"}) + add_configs("glog", {description = "Enable build with glog support", default = false, type = "boolean"}) + add_configs("ffmpeg", {description = "Enable build with ffmpeg support", default = false, type = "boolean"}) + add_configs("mobile", {description = "Enable build for mobile platform", default = false, type = "boolean"}) + add_configs("shared", {description = "Build shared library.", default = true, type = "boolean", readonly = true}) + + add_deps("cmake") + add_deps("nlohmann_json", {configs = {cmake = true}}) + add_deps("spdlog", {configs = {header_only = false, fmt_external = true}}) + add_deps("fmt") + add_deps("dlpack", "backward-cpp") + + if is_plat("windows") then + add_deps("dlfcn-win32") + elseif is_plat("linux", "bsd") then + add_syslinks("pthread", "dl") + end + + on_load(function (package) + if package:config("breakpad") then + package:add("deps", "breakpad") + end + if package:config("cuda") then + package:add("deps", "cuda") + end + if package:config("glog") then + package:add("deps", "glog") + end + if package:config("ffmpeg") then + package:add("deps", "ffmpeg") + end + if package:config("mobile") then + package:add("deps", "benchmark") + end + + if package:has_tool("cxx", "cl") then + package:add("cxxflags", "/Zc:preprocessor") + end + end) + + on_install("windows", "linux", "macosx", "mingw", function (package) + local configs = { + "-DBMF_LOCAL_DEPENDENCIES=OFF", + "-DBMF_ENABLE_PYTHON=OFF", + "-DBMF_ENABLE_TEST=OFF", + "-DCMAKE_EXPORT_COMPILE_COMMANDS=ON" + } + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + + local ver = package:version() or "1.2.0" + if ver then + table.insert(configs, "-DBMF_BUILD_VERSION=" .. ver) + end + + table.insert(configs, "-DBMF_ENABLE_BREAKPAD=" .. (package:config("breakpad") and "ON" or "OFF")) + table.insert(configs, "-DBMF_ENABLE_CUDA=" .. (package:config("cuda") and "ON" or "OFF")) + table.insert(configs, "-DBMF_ENABLE_GLOG=" .. (package:config("glog") and "ON" or "OFF")) + table.insert(configs, "-DBMF_ENABLE_FFMPEG=" .. (package:config("ffmpeg") and "ON" or "OFF")) + table.insert(configs, "-DBMF_ENABLE_MOBILE=" .. (package:config("mobile") and "ON" or "OFF")) + + local envs = import("package.tools.cmake").buildenvs(package) + if package:is_plat("windows") then + envs.SCRIPT_EXEC_MODE = "win" + end + import("package.tools.cmake").install(package, configs, {envs = envs, jobs = "1"}) + + os.cp(package:buildir() .. "/output/bmf/include", package:installdir()) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + void test() { + bmf_sdk::AudioFrame x(0, 0); + } + ]]}, {configs = {languages = "c++20"}, includes = "bmf/sdk/audio_frame.h"})) + end) From 09ee8981d2f22a622792b9a7e8835851361c919b Mon Sep 17 00:00:00 2001 From: star9029 Date: Wed, 24 Jul 2024 00:03:19 +0800 Subject: [PATCH 4/7] fix perf --- packages/b/bmf/xmake.lua | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/b/bmf/xmake.lua b/packages/b/bmf/xmake.lua index ae5426df0f5..d926e9c6b71 100644 --- a/packages/b/bmf/xmake.lua +++ b/packages/b/bmf/xmake.lua @@ -4,7 +4,7 @@ package("bmf") set_license("Apache-2.0") add_urls("https://github.com/star-hengxing/bmf/archive/refs/heads/windows-support.zip") - add_versions("v0.0.10", "36fdcf8976a577ab2fb547e69f237b639cd4b27cf0c41e490b6dcecf868f5590") + add_versions("v0.0.10", "c29df532f25c2f6278252151e2796517fc432f0120b6658779a57b3007939b73") add_configs("breakpad", {description = "Enable build with breakpad support", default = false, type = "boolean"}) add_configs("cuda", {description = "Enable CUDA support", default = false, type = "boolean"}) @@ -16,7 +16,6 @@ package("bmf") add_deps("cmake") add_deps("nlohmann_json", {configs = {cmake = true}}) add_deps("spdlog", {configs = {header_only = false, fmt_external = true}}) - add_deps("fmt") add_deps("dlpack", "backward-cpp") if is_plat("windows") then @@ -36,7 +35,7 @@ package("bmf") package:add("deps", "glog") end if package:config("ffmpeg") then - package:add("deps", "ffmpeg") + package:add("deps", "ffmpeg >=4.0.0 <5.1.0") end if package:config("mobile") then package:add("deps", "benchmark") @@ -47,17 +46,16 @@ package("bmf") end end) - on_install("windows", "linux", "macosx", "mingw", function (package) + on_install("windows", "linux", "macosx", function (package) local configs = { "-DBMF_LOCAL_DEPENDENCIES=OFF", "-DBMF_ENABLE_PYTHON=OFF", "-DBMF_ENABLE_TEST=OFF", - "-DCMAKE_EXPORT_COMPILE_COMMANDS=ON" } table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) - local ver = package:version() or "1.2.0" + local ver = package:version() or "0.0.10" if ver then table.insert(configs, "-DBMF_BUILD_VERSION=" .. ver) end From fe3228de55f2e4e810ff07f8ffd83c72bf8b95a9 Mon Sep 17 00:00:00 2001 From: star9029 Date: Thu, 25 Jul 2024 23:59:55 +0800 Subject: [PATCH 5/7] fix missing std header --- packages/b/bmf/xmake.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/b/bmf/xmake.lua b/packages/b/bmf/xmake.lua index d926e9c6b71..71dee7be3c0 100644 --- a/packages/b/bmf/xmake.lua +++ b/packages/b/bmf/xmake.lua @@ -4,7 +4,7 @@ package("bmf") set_license("Apache-2.0") add_urls("https://github.com/star-hengxing/bmf/archive/refs/heads/windows-support.zip") - add_versions("v0.0.10", "c29df532f25c2f6278252151e2796517fc432f0120b6658779a57b3007939b73") + add_versions("v0.0.10", "424918fb8c45406db4c10c1cf5307339f8368e9ecac6513dba37be45b65f5d44") add_configs("breakpad", {description = "Enable build with breakpad support", default = false, type = "boolean"}) add_configs("cuda", {description = "Enable CUDA support", default = false, type = "boolean"}) From 62e5abaa399de7286f791c93381d86a448689070 Mon Sep 17 00:00:00 2001 From: star9029 Date: Fri, 26 Jul 2024 00:01:55 +0800 Subject: [PATCH 6/7] remove jobs 1 --- packages/b/bmf/xmake.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/b/bmf/xmake.lua b/packages/b/bmf/xmake.lua index 71dee7be3c0..095f82d1280 100644 --- a/packages/b/bmf/xmake.lua +++ b/packages/b/bmf/xmake.lua @@ -70,9 +70,9 @@ package("bmf") if package:is_plat("windows") then envs.SCRIPT_EXEC_MODE = "win" end - import("package.tools.cmake").install(package, configs, {envs = envs, jobs = "1"}) + import("package.tools.cmake").install(package, configs, {envs = envs}) - os.cp(package:buildir() .. "/output/bmf/include", package:installdir()) + os.cp(path.join(package:buildir(), "output/bmf/include"), package:installdir()) end) on_test(function (package) From f185a94df6b2ff8e069ceb0d67556747058ead91 Mon Sep 17 00:00:00 2001 From: star9029 Date: Sat, 27 Jul 2024 07:43:24 +0800 Subject: [PATCH 7/7] limit plat --- packages/b/bmf/xmake.lua | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/b/bmf/xmake.lua b/packages/b/bmf/xmake.lua index 095f82d1280..78170ba542d 100644 --- a/packages/b/bmf/xmake.lua +++ b/packages/b/bmf/xmake.lua @@ -23,6 +23,15 @@ package("bmf") elseif is_plat("linux", "bsd") then add_syslinks("pthread", "dl") end + + on_check("windows", function (package) + local vs_toolset = package:toolchain("msvc"):config("vs_toolset") + if vs_toolset then + local vs_toolset_ver = import("core.base.semver").new(vs_toolset) + local minor = vs_toolset_ver:minor() + assert(minor and minor >= 30, "package(bmf): Only support >= v143 toolset") + end + end) on_load(function (package) if package:config("breakpad") then @@ -46,7 +55,7 @@ package("bmf") end end) - on_install("windows", "linux", "macosx", function (package) + on_install("windows", "linux", function (package) local configs = { "-DBMF_LOCAL_DEPENDENCIES=OFF", "-DBMF_ENABLE_PYTHON=OFF",