xmake.lua 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. package("nowide_standalone")
  2. set_homepage("https://github.com/boostorg/nowide/tree/standalone")
  3. set_description("C++ implementation of the Python Numpy library")
  4. set_license("Boost Software License, Version 1.0")
  5. add_urls("https://github.com/boostorg/nowide/releases/download/v$(version)/nowide_standalone_v$(version).tar.gz",
  6. "https://github.com/boostorg/nowide/tree/standalone")
  7. add_versions("11.3.1", "eaec4d331e3961f5eeb10c46a11691d62047900a7a40765b0f23cdd3181e6ca6")
  8. add_versions("11.3.0", "153ac93173c8de9c08e7701e471fa750f84c27e51fe329570c5aa06016591f8c")
  9. add_versions("11.2.0", "1869d176a8af389e4f7416f42bdd15d6a5db3c6e4ae77269ecb071a232304e1d")
  10. add_deps("cmake")
  11. if is_plat("windows", "mingw") then
  12. add_syslinks("shell32")
  13. end
  14. on_install(function (package)
  15. if package:config("shared") then
  16. package:add("defines", "NOWIDE_DYN_LINK")
  17. end
  18. local configs = {"-DBUILD_TESTING=OFF", "-DNOWIDE_WERROR=OFF"}
  19. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
  20. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  21. import("package.tools.cmake").install(package, configs)
  22. end)
  23. on_test(function (package)
  24. assert(package:check_cxxsnippets({test = [[
  25. #include <nowide/args.hpp>
  26. int test(int argc, char **argv)
  27. {
  28. nowide::args _(argc, argv); // Must use an instance!
  29. return argc;
  30. }
  31. ]]}))
  32. end)