xmake.lua 938 B

1234567891011121314151617181920212223
  1. package("optional-lite")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://github.com/martinmoene/optional-lite")
  4. set_description("optional lite - A C++17-like optional, a nullable object for C++98, C++11 and later in a single-file header-only library")
  5. set_license("BSL-1.0")
  6. add_urls("https://github.com/martinmoene/optional-lite/archive/refs/tags/$(version).tar.gz",
  7. "https://github.com/martinmoene/optional-lite.git")
  8. add_versions("v3.6.0", "2be17fcfc764809612282c3e728cabc42afe703b9dc333cc87c48d882fcfc2c2")
  9. on_install(function (package)
  10. os.cp("include", package:installdir())
  11. end)
  12. on_test(function (package)
  13. assert(package:check_cxxsnippets({test = [[
  14. #include <nonstd/optional.hpp>
  15. nonstd::optional<int> test() {
  16. return nonstd::nullopt;
  17. }
  18. ]]}, {configs = {languages = "c++11"}}))
  19. end)