xmake.lua 1.3 KB

1234567891011121314151617181920212223242526272829303132
  1. package("quickcpplib")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://github.com/ned14/quickcpplib")
  4. set_description("Eliminate all the tedious hassle when making state-of-the-art C++ 14 - 23 libraries!")
  5. set_license("Apache-2.0")
  6. add_urls("https://github.com/ned14/quickcpplib.git")
  7. add_versions("20221116", "52163d5a198f1d0a2583e683f090778686f9f998")
  8. on_install(function (package)
  9. io.writefile("xmake.lua", [[
  10. target("quickcpplib")
  11. set_kind("headeronly")
  12. add_headerfiles("include/(quickcpplib/**.hpp)")
  13. add_headerfiles("include/(quickcpplib/**.h)")
  14. add_headerfiles("include/(quickcpplib/**.ixx)")
  15. add_headerfiles("include/(quickcpplib/**.ipp)")
  16. add_includedirs("include")
  17. ]])
  18. import("package.tools.xmake").install(package)
  19. end)
  20. on_test(function (package)
  21. local cxxflags = package:has_tool("cxx", "clang", "clangxx") and {"-fsized-deallocation"} or {}
  22. assert(package:check_cxxsnippets({test = [[
  23. #include <quickcpplib/uint128.hpp>
  24. void test () {
  25. auto bar = QUICKCPPLIB_NAMESPACE::integers128::uint128{};
  26. }
  27. ]]}, {configs = {languages = "c++17", cxxflags = cxxflags}}))
  28. end)