2
0

xmake.lua 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. package("tomlcpp")
  2. set_homepage("https://github.com/cktan/tomlcpp")
  3. set_description("No fanfare TOML C++ Library")
  4. set_license("MIT")
  5. add_urls("https://github.com/cktan/tomlcpp.git")
  6. add_versions("2022.06.25", "4212f1fccf530e276a2e1b63d3f99fbfb84e86a4")
  7. add_deps("tomlc99")
  8. on_install(function (package)
  9. io.writefile("xmake.lua", [[
  10. add_requires("tomlc99")
  11. set_languages("c++14")
  12. add_rules("mode.release", "mode.debug")
  13. target("tomlcpp")
  14. set_kind("$(kind)")
  15. add_files("tomlcpp.cpp")
  16. add_headerfiles("tomlcpp.hpp")
  17. if is_plat("windows") and is_kind("shared") then
  18. add_rules("utils.symbols.export_all", {export_classes = true})
  19. end
  20. add_packages("tomlc99")
  21. ]])
  22. import("package.tools.xmake").install(package)
  23. end)
  24. on_test(function (package)
  25. assert(package:check_cxxsnippets({test = [[
  26. #include <tomlcpp.hpp>
  27. void test() {
  28. auto res = toml::parseFile("sample.toml");
  29. }
  30. ]]}, {configs = {languages = "c++14"}}))
  31. end)