xmake.lua 1.5 KB

12345678910111213141516171819202122232425262728293031323334
  1. package("quantlib")
  2. set_homepage("http://quantlib.org")
  3. set_description("The QuantLib C++ library")
  4. add_urls("https://github.com/lballabio/QuantLib/releases/download/v$(version)/QuantLib-$(version).tar.gz",
  5. "https://github.com/lballabio/QuantLib.git")
  6. add_versions("1.34", "eb87aa8ced76550361771e167eba26aace018074ec370f7af49a01aa56b2fe50")
  7. add_versions("1.33", "4810d789261eb36423c7d277266a6ee3b28a3c05af1ee0d45544ca2e0e8312bd")
  8. if is_plat("windows") then
  9. add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true})
  10. end
  11. add_deps("cmake")
  12. add_deps("boost")
  13. on_install("windows", "linux", "macosx", "bsd", "mingw", "msys", "cross", function (package)
  14. local configs = {"-DQL_BUILD_BENCHMARK=OFF", "-DQL_BUILD_EXAMPLES=OFF", "-DQL_BUILD_TEST_SUITE=OFF"}
  15. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
  16. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  17. import("package.tools.cmake").install(package, configs)
  18. end)
  19. on_test(function (package)
  20. assert(package:check_cxxsnippets({test = [[
  21. #include <ql/time/calendars/target.hpp>
  22. using namespace QuantLib;
  23. void test() {
  24. Calendar calendar = TARGET();
  25. Date todaysDate(19, March, 2014);
  26. }
  27. ]]}, {configs = {languages = "c++14"}}))
  28. end)