xmake.lua 1.1 KB

12345678910111213141516171819202122232425
  1. package("pahomqttc")
  2. set_homepage("https://github.com/eclipse/paho.mqtt.c")
  3. set_description("Eclipse Paho MQTT C Client Library")
  4. set_license("MIT")
  5. add_urls("https://github.com/eclipse/paho.mqtt.c/archive/refs/tags/$(version).zip",
  6. "https://github.com/eclipse/paho.mqtt.c.git")
  7. add_versions("v1.3.13", "5ba7c7ab7ebb1499938fa2e358e6c1f9a926b270f2bf082acf89d59b4771a132")
  8. add_deps("cmake")
  9. on_install("windows", "linux", "macosx", function (package)
  10. local configs = {"-DPAHO_BUILD_SAMPLES=FALSE",
  11. "-DPAHO_WITH_SSL=FALSE",
  12. "-DPAHO_BUILD_DOCUMENTATION=FALSE"}
  13. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
  14. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  15. import("package.tools.cmake").install(package, configs)
  16. end)
  17. on_test(function (package)
  18. assert(package:has_cfuncs("MQTTClient_connect", {includes = "MQTTClient.h"}))
  19. end)
  20. package_end()