You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

pybind11.cmake 758 B

5 years ago
5 years ago
12345678910111213141516171819
  1. if (ENABLE_GITEE)
  2. set(REQ_URL "https://gitee.com/mirrors/pybind11/repository/archive/v2.4.3.tar.gz")
  3. set(MD5 "b473a37987ce456ea8cc7aab3f9486f9")
  4. else()
  5. set(REQ_URL "https://github.com/pybind/pybind11/archive/v2.4.3.tar.gz")
  6. set(MD5 "62254c40f89925bb894be421fe4cdef2")
  7. endif ()
  8. set(pybind11_CXXFLAGS "-D_FORTIFY_SOURCE=2 -O2")
  9. set(pybind11_CFLAGS "-D_FORTIFY_SOURCE=2 -O2")
  10. mindspore_add_pkg(pybind11
  11. VER 2.4.3
  12. URL ${REQ_URL}
  13. MD5 ${MD5}
  14. CMAKE_OPTION -DPYBIND11_TEST=OFF -DPYBIND11_LTO_CXX_FLAGS=FALSE
  15. )
  16. include_directories(${pybind11_INC})
  17. find_package(pybind11 REQUIRED)
  18. set_property(TARGET pybind11::module PROPERTY IMPORTED_GLOBAL TRUE)
  19. add_library(mindspore::pybind11_module ALIAS pybind11::module)