xmake.lua 1.4 KB

1234567891011121314151617181920212223242526272829
  1. package("aws-c-common")
  2. set_homepage("https://github.com/awslabs/aws-c-common")
  3. set_description("Core c99 package for AWS SDK for C")
  4. set_license("Apache-2.0")
  5. add_urls("https://github.com/awslabs/aws-c-common/archive/$(version).tar.gz",
  6. "https://github.com/awslabs/aws-c-common.git")
  7. add_versions("v0.6.9", "928a3e36f24d1ee46f9eec360ec5cebfe8b9b8994fe39d4fa74ff51aebb12717")
  8. if is_plat("linux") then
  9. add_deps("cmake")
  10. add_syslinks("dl", "m", "pthread", "rt")
  11. end
  12. on_install("linux", function (package)
  13. local configs = {}
  14. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
  15. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  16. table.insert(configs, "-DPERFORM_HEADER_CHECK=ON")
  17. table.insert(configs, "-DENABLE_NET_TESTS=OFF")
  18. import("package.tools.cmake").install(package, configs)
  19. end)
  20. on_test(function (package)
  21. assert(package:has_cfuncs("aws_common_library_init", {includes = "aws/common/common.h"}))
  22. assert(package:has_cfuncs("aws_common_library_clean_up", {includes = "aws/common/common.h"}))
  23. assert(package:has_cfuncs("aws_ring_buffer_init", {includes = "aws/common/ring_buffer.h"}))
  24. assert(package:has_cfuncs("aws_uuid_init", {includes = "aws/common/uuid.h"}))
  25. end)