xmake.lua 1.5 KB

123456789101112131415161718192021222324252627282930313233
  1. package("zycore-c")
  2. set_homepage("https://github.com/zyantific/zycore-c")
  3. set_description("Internal library providing platform independent types, macros and a fallback for environments without LibC.")
  4. set_license("MIT")
  5. add_urls("https://github.com/zyantific/zycore-c/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/zyantific/zycore-c.git")
  7. add_versions("v1.1.0", "b5496779b95206763980aad30db10e36a13a10ebaf2e74574cddf2ca744ad227")
  8. add_versions("v1.0.0", "aa93d6da992953693754834c130ce193980b7d7137ea2d41c2c1f618c65e4545")
  9. add_deps("cmake")
  10. on_install(function (package)
  11. if package:version():eq("v1.1.0") and package:is_plat("mingw") then
  12. local rc_str = io.readfile("resources/VersionInfo.rc", {encoding = "utf16le"})
  13. io.writefile("resources/VersionInfo.rc", rc_str, {encoding = "utf8"})
  14. end
  15. local configs = {}
  16. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
  17. table.insert(configs, "-DZYCORE_BUILD_SHARED_LIB=" .. (package:config("shared") and "ON" or "OFF"))
  18. import("package.tools.cmake").install(package, configs)
  19. end)
  20. on_test(function (package)
  21. assert(package:check_cxxsnippets({test = [[
  22. #include <Zycore/Comparison.h>
  23. #include <Zycore/Vector.h>
  24. void test() {
  25. ZyanVector vector;
  26. ZyanU16 buffer[32];
  27. }
  28. ]]}))
  29. end)