xmake.lua 1.0 KB

1234567891011121314151617181920212223242526
  1. package("microsoft-gsl")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://github.com/microsoft/GSL")
  4. set_description("Guidelines Support Library")
  5. set_license("MIT")
  6. add_urls("https://github.com/microsoft/GSL/archive/$(version).tar.gz",
  7. "https://github.com/microsoft/GSL.git")
  8. add_versions("v3.1.0", "d3234d7f94cea4389e3ca70619b82e8fb4c2f33bb3a070799f1e18eef500a083")
  9. add_versions("v4.0.0", "f0e32cb10654fea91ad56bde89170d78cfbf4363ee0b01d8f097de2ba49f6ce9")
  10. on_install(function (package)
  11. os.mv("include/gsl", package:installdir("include"))
  12. end)
  13. on_test(function (package)
  14. assert(package:check_cxxsnippets({test = [[
  15. #include <vector>
  16. #include <type_traits>
  17. void test() {
  18. std::vector<int> v{1,2,3,4};
  19. gsl::span sp{v};
  20. static_assert(std::is_same<decltype(sp), gsl::span<int>>::value);
  21. }
  22. ]]}, {configs = {languages = "c++17"}, includes = "gsl/span"}))
  23. end)