xmake.lua 1.0 KB

12345678910111213141516171819202122232425
  1. package("fastcppcsvparser")
  2. set_homepage("https://github.com/ben-strasser/fast-cpp-csv-parser")
  3. set_description("This is a small, easy-to-use and fast header-only library for reading comma separated value (CSV) files (by ben-strasser)")
  4. add_urls("https://github.com/ben-strasser/fast-cpp-csv-parser.git")
  5. add_versions("2021.01.03", "75600d0b77448e6c410893830df0aec1dbacf8e3")
  6. on_install(function (package)
  7. if package:is_plat("macosx", "iphoneos") then
  8. io.replace("csv.h", "noexcept", "_NOEXCEPT")
  9. end
  10. os.cp("csv.h", package:installdir("include"))
  11. end)
  12. on_test(function (package)
  13. assert(package:check_cxxsnippets({test = [[
  14. void test() {
  15. io::CSVReader<3> in("example.csv");
  16. in.read_header(io::ignore_extra_column, "vendor", "size", "speed");
  17. std::string vendor; int size; double speed;
  18. while(in.read_row(vendor, size, speed));
  19. }
  20. ]]}, {includes = "csv.h", configs = {languages = "cxx11"}}))
  21. end)