xmake.lua 1005 B

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