xmake.lua 1.7 KB

12345678910111213141516171819202122232425262728293031323334
  1. package("pybind11")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://github.com/pybind/pybind11")
  4. set_description("Seamless operability between C++11 and Python.")
  5. set_license("BSD-3-Clause")
  6. add_urls("https://github.com/pybind/pybind11/archive/$(version).zip",
  7. "https://github.com/pybind/pybind11.git")
  8. add_versions("v2.5.0", "1859f121837f6c41b0c6223d617b85a63f2f72132bae3135a2aa290582d61520")
  9. add_versions("v2.6.2", "0bdb5fd9616fcfa20918d043501883bf912502843d5afc5bc7329a8bceb157b3")
  10. add_versions("v2.7.1", "350ebf8f4c025687503a80350897c95d8271bf536d98261f0b8ed2c1a697070f")
  11. add_versions("v2.8.1", "90907e50b76c8e04f1b99e751958d18e72c4cffa750474b5395a93042035e4a3")
  12. add_versions("v2.9.1", "ef9e63be55b3b29b4447ead511a7a898fdf36847f21cec27a13df0db051ed96b")
  13. add_versions("v2.9.2", "d1646e6f70d8a3acb2ddd85ce1ed543b5dd579c68b8fb8e9638282af20edead8")
  14. add_versions("v2.10.0", "225df6e6dea7cea7c5754d4ed954e9ca7c43947b849b3795f87cb56437f1bd19")
  15. add_versions("v2.12.0", "411f77380c43798506b39ec594fc7f2b532a13c4db674fcf2b1ca344efaefb68")
  16. add_deps("cmake", "python 3.x")
  17. on_install("windows", "macosx", "linux", function (package)
  18. import("package.tools.cmake").install(package, {"-DPYBIND11_TEST=OFF"})
  19. end)
  20. on_test(function (package)
  21. assert(package:check_cxxsnippets({test = [[
  22. #include <pybind11/pybind11.h>
  23. int add(int i, int j) {
  24. return i + j;
  25. }
  26. PYBIND11_MODULE(example, m) {
  27. m.def("add", &add, "A function which adds two numbers");
  28. }
  29. ]]}, {configs = {languages = "c++11"}}))
  30. end)