xmake.lua 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. package("syscmdline")
  2. set_homepage("https://github.com/SineStriker/syscmdline")
  3. set_description("C++ Advanced Command Line Parser")
  4. set_license("MIT")
  5. add_urls("https://github.com/SineStriker/syscmdline.git")
  6. add_versions("2024.03.27", "70e18ba18056bff1bebab924dde73dbbf04d46f9")
  7. add_deps("cmake")
  8. if is_plat("windows", "mingw") then
  9. add_syslinks("shell32")
  10. end
  11. on_install(function (package)
  12. if not package:config("shared") then
  13. package:add("defines", "SYSCMDLINE_STATIC")
  14. end
  15. local configs = {}
  16. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
  17. table.insert(configs, "-DSYSCMDLINE_BUILD_STATIC=" .. (package:config("shared") and "OFF" or "ON"))
  18. import("package.tools.cmake").install(package, configs)
  19. end)
  20. on_test(function (package)
  21. assert(package:check_cxxsnippets({test = [[
  22. namespace SCL = SysCmdLine;
  23. void test() {
  24. SCL::Command cmd("mv", "move files to directory");
  25. }
  26. ]]}, {configs = {languages = "c++17"}, includes = "syscmdline/parser.h"}))
  27. end)