package An official xmake package repository
https://xrepo.xmake.io/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.7 KiB
40 lines
1.7 KiB
package("dispenso") |
|
set_homepage("https://github.com/facebookincubator/dispenso") |
|
set_description("The project provides high-performance concurrency, enabling highly parallel computation.") |
|
set_license("MIT") |
|
|
|
add_urls("https://github.com/facebookincubator/dispenso/archive/refs/tags/$(version).tar.gz", |
|
"https://github.com/facebookincubator/dispenso.git") |
|
|
|
add_versions("v1.1.0", "581f95c16cd479692bc89448d0648f6ce24162454308c544c4d35bf5e9efe5c8") |
|
|
|
if is_plat("linux", "bsd") then |
|
add_syslinks("pthread") |
|
elseif is_plat("windows", "mingw") then |
|
add_defines("NOMINMAX") |
|
add_syslinks("winmm", "synchronization") |
|
end |
|
|
|
add_deps("cmake") |
|
add_deps("concurrentqueue") |
|
|
|
on_install("windows|x64", "linux", "macosx", "bsd", "mingw", "msys", "android", "iphoneos", "cross", "wasm", function (package) |
|
local configs = {} |
|
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) |
|
table.insert(configs, "-DDISPENSO_SHARED_LIB=" .. (package:config("shared") and "ON" or "OFF")) |
|
|
|
io.replace("dispenso/CMakeLists.txt", "-Werror", "", {plain = true}) |
|
io.replace("dispenso/CMakeLists.txt", "Synchronization", "Synchronization winmm", {plain = true}) |
|
import("package.tools.cmake").install(package, configs) |
|
|
|
os.tryrm(package:installdir("include/dispenso/third-party")) |
|
end) |
|
|
|
on_test(function (package) |
|
assert(package:check_cxxsnippets({test = [[ |
|
#include <dispenso/thread_pool.h> |
|
void test() { |
|
dispenso::ThreadPool& threadPool = dispenso::globalThreadPool(); |
|
} |
|
]]}, {configs = {languages = "c++14"}})) |
|
end)
|
|
|