xmake.lua 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package("aws-c-io")
  2. set_homepage("https://github.com/awslabs/aws-c-io")
  3. set_description("This is a module for the AWS SDK for C. It handles all IO and TLS work for application protocols. ")
  4. set_license("Apache-2.0")
  5. add_urls("https://github.com/awslabs/aws-c-io/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/awslabs/aws-c-io.git")
  7. add_versions("v0.14.6", "bb3af305af748185b1c7b17afa343e54f2d494ccff397402f1b17041b0967865")
  8. add_versions("v0.14.5", "2700bcde062f7de1c1cbfd236b9fdfc9b24b4aa6dc0fb09bb156e16e07ebd0b6")
  9. add_versions("v0.13.32", "2a6b18c544d014ca4f55cb96002dbbc1e52a2120541c809fa974cb0838ea72cc")
  10. add_configs("asan", {description = "Enable Address Sanitize.", default = false, type = "boolean"})
  11. if is_plat("windows") then
  12. add_syslinks("advapi32", "crypt32", "secur32", "ncrypt")
  13. elseif is_plat("linux", "bsd", "cross") then
  14. add_deps("s2n-tls")
  15. elseif is_plat("macosx") then
  16. add_frameworks("Security")
  17. end
  18. add_deps("cmake", "aws-c-common", "aws-c-cal")
  19. on_install("windows|x64", "windows|x86", "linux", "macosx", "bsd", "msys", "cross", function (package)
  20. local cmakedir = package:dep("aws-c-common"):installdir("lib", "cmake")
  21. if package:is_plat("windows") then
  22. cmakedir = cmakedir:gsub("\\", "/")
  23. end
  24. local configs = {"-DBUILD_TESTING=OFF", "-DCMAKE_MODULE_PATH=" .. cmakedir}
  25. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
  26. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  27. table.insert(configs, "-DENABLE_SANITIZERS=" .. (package:config("asan") and "ON" or "OFF"))
  28. if package:is_plat("windows") then
  29. table.insert(configs, "-DAWS_STATIC_MSVC_RUNTIME_LIBRARY=" .. (package:config("vs_runtime"):startswith("MT") and "ON" or "OFF"))
  30. end
  31. import("package.tools.cmake").install(package, configs)
  32. end)
  33. on_test(function (package)
  34. assert(package:has_cfuncs("aws_io_library_init", {includes = "aws/io/io.h"}))
  35. end)