2
0

xmake.lua 1.4 KB

12345678910111213141516171819202122232425262728293031323334
  1. package("corrade")
  2. set_homepage("https://magnum.graphics/corrade/")
  3. set_description("Corrade is a multiplatform utility library written in C++11/C++14.")
  4. set_license("MIT")
  5. add_urls("https://github.com/mosra/corrade/archive/refs/tags/$(version).zip",
  6. "https://github.com/mosra/corrade.git")
  7. add_versions("v2020.06", "d89a06128c334920d91fecf23cc1df48fd6be26543dc0ed81b2f819a92d70e72")
  8. if is_plat("windows") then
  9. add_syslinks("shell32")
  10. elseif is_plat("linux") then
  11. add_syslinks("dl")
  12. end
  13. add_deps("cmake")
  14. on_install("windows", "linux", "macosx", function (package)
  15. local configs = {"-DBUILD_TESTS=OFF", "-DLIB_SUFFIX="}
  16. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
  17. table.insert(configs, "-DBUILD_STATIC=" .. (package:config("shared") and "OFF" or "ON"))
  18. import("package.tools.cmake").install(package, configs)
  19. package:addenv("PATH", "bin")
  20. end)
  21. on_test(function (package)
  22. os.vrun("corrade-rc --help")
  23. assert(package:check_cxxsnippets({test = [[
  24. #include <string>
  25. void test() {
  26. Corrade::Utility::Resource rs{"data"};
  27. rs.get(std::string("license.txt"));
  28. }
  29. ]]}, {configs = {languages = "c++14"}, includes = "Corrade/Utility/Resource.h"}))
  30. end)