xmake.lua 1.1 KB

12345678910111213141516171819202122232425262728
  1. package("pigpio")
  2. set_homepage("https://github.com/joan2937/pigpio")
  3. set_description("pigpio is a C library for the Raspberry which allows control of the General Purpose Input Outputs (GPIO).")
  4. add_urls("https://github.com/joan2937/pigpio/archive/refs/tags/$(version).tar.gz",
  5. "https://github.com/joan2937/pigpio.git")
  6. add_versions("v79", "c5337c0b7ae888caf0262a6f476af0e2ab67065f7650148a0b21900b8d1eaed7")
  7. add_syslinks("pthread")
  8. add_deps("cmake")
  9. on_install("linux", function (package)
  10. local configs = {}
  11. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
  12. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  13. import("package.tools.cmake").install(package, configs)
  14. end)
  15. on_test(function (package)
  16. assert(package:check_cxxsnippets({test = [[
  17. #include <pigpio.h>
  18. void test() {
  19. gpioSetMode(0, PI_INPUT);
  20. }
  21. ]]}, {configs = {languages = "c++11"}}))
  22. end)