-
-
Notifications
You must be signed in to change notification settings - Fork 398
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bmf: add package #4286
Draft
star-hengxing
wants to merge
8
commits into
dev
Choose a base branch
from
bmf
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
bmf: add package #4286
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
8e2eeea
bmf: add package
star-hengxing f763665
Revert "bmf: add package"
star-hengxing bd1695e
Merge remote-tracking branch 'upstream/dev' into bmf
star-hengxing 5592dd1
try port
star-hengxing 09ee898
fix perf
star-hengxing fe3228d
fix missing std header
star-hengxing 62e5aba
remove jobs 1
star-hengxing f185a94
limit plat
star-hengxing File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
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", "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"}) | ||
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("dlpack", "backward-cpp") | ||
|
||
if is_plat("windows") then | ||
add_deps("dlfcn-win32") | ||
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 | ||
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 >=4.0.0 <5.1.0") | ||
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", function (package) | ||
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() or "0.0.10" | ||
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}) | ||
|
||
os.cp(path.join(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) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这 url 咋这么怪,后面不会自动更新 break hash 么?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个库目前很多问题,需要手动改大量代码