xmake.lua 1.1 KB

123456789101112131415161718192021222324252627
  1. package("yaml_cpp_struct")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://github.com/fantasy-peak/yaml_cpp_struct")
  4. set_description("It's easy to mapping yaml to cpp's struct")
  5. set_license("MIT")
  6. add_urls("https://github.com/fantasy-peak/yaml_cpp_struct/archive/refs/tags/$(version).tar.gz",
  7. "https://github.com/fantasy-peak/yaml_cpp_struct.git")
  8. add_versions('v1.0.2', '7635bb968690f97f9be420e42de2120b1101f0ab20173ddec8d24b5de16f25e5')
  9. add_deps("magic_enum", "visit_struct", "yaml-cpp")
  10. on_install("windows", "linux", "macosx", "mingw", function (package)
  11. os.cp("include", package:installdir())
  12. end)
  13. on_test(function (package)
  14. assert(package:check_cxxsnippets({test = [[
  15. struct Config {
  16. std::string name;
  17. };
  18. YCS_ADD_STRUCT(Config, name)
  19. void test() {
  20. auto [cfg, error] = yaml_cpp_struct::from_yaml<Config>("a.txt");
  21. }
  22. ]]}, {configs = {languages = "c++17"}, includes = {"yaml_cpp_struct.hpp"}}))
  23. end)