xmake.lua 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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("v48", "eebd18456975251ea3450b815e241cccfefba5b883e4a36bd309f9cf629bdec6")
  9. add_versions("v47", "4a1d79260c1e49e065efe0817c8b9646098ba27eed1802b0c3ba7d959e4e5e84")
  10. add_versions("v43", "86a0afa2e97347202a0a883ab43da78c1d4bfff0d6cb93205cfc433d0d9eb9eb")
  11. add_deps("cmake")
  12. on_install(function (package)
  13. local configs = {
  14. "-DTROMPELOEIL_BUILD_TESTS=OFF",
  15. "-DTROMPELOEIL_INSTALL_DOCS=OFF"
  16. }
  17. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
  18. import("package.tools.cmake").install(package, configs)
  19. end)
  20. on_test(function (package)
  21. assert(package:check_cxxsnippets({test = [[
  22. class Interface
  23. {
  24. public:
  25. virtual bool foo(int, std::string& s) = 0;
  26. };
  27. class Mock : public Interface
  28. {
  29. public:
  30. MAKE_MOCK2(foo, bool(int, std::string&),override);
  31. };
  32. ]]}, {configs = {languages = "c++14"}, includes = { "trompeloeil.hpp" }}))
  33. end)