xmake.lua 1.5 KB

1234567891011121314151617181920212223242526272829303132333435
  1. package("cpp-ipc")
  2. set_homepage("https://github.com/mutouyun/cpp-ipc")
  3. set_description("A high-performance inter-process communication using shared memory on Linux/Windows")
  4. set_license("MIT")
  5. set_urls("https://github.com/mutouyun/cpp-ipc/archive/refs/tags/v$(version).zip",
  6. "https://github.com/mutouyun/cpp-ipc.git")
  7. add_versions("1.3.0", "898f97a36c855a58dfe9645b73c388e6df7bcd3762a5c9a6a75b4bca60d72b4b")
  8. add_versions("1.2.0", "31739760d8f191c7aaf71d1c453fce1989d1f74fdee9a61f9fdd475b29fe1888")
  9. add_deps("cmake")
  10. if is_plat("windows") then
  11. add_syslinks("advapi32")
  12. end
  13. on_install("windows", "linux", "mingw", function (package)
  14. local configs = {"-DLIBIPC_BUILD_TESTS=OFF", "-DLIBIPC_BUILD_DEMOS=OFF"}
  15. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
  16. table.insert(configs, "-DLIBIPC_BUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  17. if package:is_plat("windows") and package:config("vs_runtime"):startswith("MD") then
  18. table.insert(configs, "-DLIBIPC_USE_STATIC_CRT=OFF")
  19. else
  20. table.insert(configs, "-DLIBIPC_USE_STATIC_CRT=ON")
  21. end
  22. import("package.tools.cmake").install(package, configs)
  23. end)
  24. on_test(function (package)
  25. assert(package:check_cxxsnippets({test = [[
  26. #include "libipc/ipc.h"
  27. void test() { ipc::route cc { "my-ipc-route" }; }
  28. ]]}, {configs = {languages = "c++17"}}))
  29. end)