xmake.lua 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package("trompeloeil")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://github.com/rollbear/trompeloeil")
  4. set_description("A thread-safe header-only mocking framework for C++11/14 using the Boost Software License 1.0")
  5. set_license("BSL-1.0")
  6. add_urls("https://github.com/rollbear/trompeloeil/archive/refs/tags/$(version).tar.gz",
  7. "https://github.com/rollbear/trompeloeil.git")
  8. add_versions("v49", "2523571fb7920b2813cbc23b46e60294aba8ead7eba434bfec69c24408615593")
  9. add_versions("v48", "eebd18456975251ea3450b815e241cccfefba5b883e4a36bd309f9cf629bdec6")
  10. add_versions("v47", "4a1d79260c1e49e065efe0817c8b9646098ba27eed1802b0c3ba7d959e4e5e84")
  11. add_versions("v43", "86a0afa2e97347202a0a883ab43da78c1d4bfff0d6cb93205cfc433d0d9eb9eb")
  12. add_deps("cmake")
  13. on_install(function (package)
  14. local configs = {
  15. "-DTROMPELOEIL_BUILD_TESTS=OFF",
  16. "-DTROMPELOEIL_INSTALL_DOCS=OFF"
  17. }
  18. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
  19. import("package.tools.cmake").install(package, configs)
  20. end)
  21. on_test(function (package)
  22. assert(package:check_cxxsnippets({test = [[
  23. class Interface
  24. {
  25. public:
  26. virtual bool foo(int, std::string& s) = 0;
  27. };
  28. class Mock : public Interface
  29. {
  30. public:
  31. MAKE_MOCK2(foo, bool(int, std::string&),override);
  32. };
  33. ]]}, {configs = {languages = "c++14"}, includes = { "trompeloeil.hpp" }}))
  34. end)