Skip to content
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

libfacedetection: add package #2773

Merged
merged 5 commits into from
Nov 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions packages/l/libfacedetection/xmake.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package("libfacedetection")
set_homepage("https://github.com/ShiqiYu/libfacedetection")
set_description("An open source library for face detection in images. The face detection speed can reach 1000FPS. ")
set_license("BSD-3-Clause")

add_urls("https://github.com/ShiqiYu/libfacedetection/archive/refs/tags/$(version).tar.gz",
"https://github.com/ShiqiYu/libfacedetection.git")

add_versions("v3.0", "66dc6b47b11db4bf4ef73e8b133327aa964dbd8b2ce9e0ef4d1e94ca08d40b6a")

add_configs("neon", {description = "Use neon", default = is_arch("arm.*"), type = "boolean"})
add_configs("avx512", {description = "Use avx512", default = false, type = "boolean"})
add_configs("avx2", {description = "Use avx2", default = not is_arch("arm.*"), type = "boolean"})
add_configs("openmp", {description = "Use openmp", default = false, type = "boolean"})

add_deps("cmake")

on_install("windows", "linux", "macosx", "bsd", "mingw", "msys", "android", "iphoneos", 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"))
if package:is_arch("arm.*") then
table.insert(configs, "-DENABLE_NEON=" .. (package:config("neon") and "ON" or "OFF"))
table.insert(configs, "-DENABLE_AVX512=OFF")
table.insert(configs, "-DENABLE_AVX2=OFF")
else
table.insert(configs, "-DENABLE_NEON=OFF")
table.insert(configs, "-DENABLE_AVX512=" .. (package:config("avx512") and "ON" or "OFF"))
table.insert(configs, "-DENABLE_AVX2=" .. (package:config("avx2") and "ON" or "OFF"))
end
table.insert(configs, "-DUSE_OPENMP=" .. (package:config("openmp") and "ON" or "OFF"))
import("package.tools.cmake").install(package, configs)
end)

on_test(function (package)
assert(package:has_cxxfuncs("facedetect_cnn", {includes = "facedetection/facedetectcnn.h", configs = {languages = "c++11"}}))
end)