xmake.lua 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. package("crossguid")
  2. set_homepage("https://github.com/graeme-hill/crossguid")
  3. set_description("Lightweight cross platform C++ GUID/UUID library")
  4. set_license("MIT")
  5. add_urls("https://github.com/graeme-hill/crossguid.git")
  6. add_versions("2019.3.29", "ca1bf4b810e2d188d04cb6286f957008ee1b7681")
  7. if is_plat("macosx") then
  8. add_patches("master", path.join(os.scriptdir(), "patches", "warnings.patch"), "52546cb4b33bb467bd901d54a1bc97a467b5861ff54c5e39063de9540313adbb")
  9. elseif is_plat("linux") then
  10. add_deps("libuuid")
  11. elseif is_plat("windows") then
  12. add_syslinks("Ole32")
  13. end
  14. add_deps("cmake")
  15. on_install(function (package)
  16. local configs = {"-DCROSSGUID_TESTS=OFF"}
  17. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
  18. import("package.tools.cmake").install(package, configs, {buildir = "build"})
  19. if package:is_plat("windows") then
  20. os.trycp("build/pbd/**.pdb", package:installdir("lib"))
  21. end
  22. end)
  23. on_test(function (package)
  24. assert(package:check_cxxsnippets({test = [[
  25. #include <crossguid/guid.hpp>
  26. void test() {
  27. auto g = xg::newGuid();
  28. }
  29. ]]}, {configs = {languages = "c++17"}}))
  30. end)