add workspace_hanya library (#2104)

* add mysql-connector-c

* add vld

* add vld

* use has_cfuncs

* add workspace

* Fix mistakes

* Delete packages/w/workspace directory

* add workspace

* Update xmake.lua

* Update xmake.lua

---------

Co-authored-by: xiaozhu <alex.gong@dbappsecurity.com.cn>
Co-authored-by: cat <nihaoaheheda@gmail.com>
pull/2106/head
xpxz 2 years ago committed by GitHub
parent dd20fe18ee
commit 6f6bcf4c91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 37
      packages/w/workspace_hanya/xmake.lua

@ -0,0 +1,37 @@
package("workspace_hanya")
set_homepage("https://github.com/CodingHanYa/workspace")
set_description("Workspace is a lightweight asynchronous execution framework based on C++11")
set_license("Apache-2.0")
set_urls("https://github.com/CodingHanYa/workspace.git")
add_versions("2023.5.8", "d53b4f6a2900db328168ca7b496edc976308e4e6")
add_deps("cmake")
if is_plat("linux") then
add_syslinks("pthread")
end
on_install("windows", "linux", "macosx", "mingw", function (package)
if is_plat("linux") then
io.replace("CMakeLists.txt", "install(DIRECTORY ${LIB_HEADER} DESTINATION ${INSTALL_INCLUDEDIR}/${LIB_NAME})", "install(DIRECTORY ${LIB_HEADER} DESTINATION ${LIB_NAME})", {plain = true})
end
import("package.tools.cmake").install(package, configs)
os.cp("include", package:installdir())
end)
on_test(function (package)
assert(package:check_cxxsnippets({test = [[
#include <workspace/workspace.h>
int main() {
wsp::workbranch br("My First BR", 2);
br.submit([]{ std::cout<<"hello world"<<std::endl; });
auto result = br.submit([]{ return 2023; });
std::cout<<"Got "<<result.get()<<std::endl;
br.wait_tasks(1000);
}
]]}, {configs = {languages = "c++17"}}))
end)
Loading…
Cancel
Save