2
0

xmake.lua 1.4 KB

123456789101112131415161718192021222324252627282930313233
  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/$(version).zip",
  6. "https://github.com/mutouyun/cpp-ipc.git")
  7. add_versions("v1.3.0", "898f97a36c855a58dfe9645b73c388e6df7bcd3762a5c9a6a75b4bca60d72b4b")
  8. add_versions("v1.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", "cross", function (package)
  14. if package:config("shared") then
  15. package:add("defines", "LIBIPC_LIBRARY_SHARED_USING__")
  16. end
  17. local configs = {"-DLIBIPC_BUILD_TESTS=OFF", "-DLIBIPC_BUILD_DEMOS=OFF", "-DLIBIPC_USE_STATIC_CRT=OFF"}
  18. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
  19. table.insert(configs, "-DLIBIPC_BUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  20. import("package.tools.cmake").install(package, configs)
  21. end)
  22. on_test(function (package)
  23. assert(package:check_cxxsnippets({test = [[
  24. #include "libipc/ipc.h"
  25. void test() { ipc::route cc { "my-ipc-route" }; }
  26. ]]}, {configs = {languages = "c++17"}}))
  27. end)