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.

json.cmake 876 B

1234567891011121314151617181920212223242526
  1. if(MSVC)
  2. set(flatbuffers_CXXFLAGS "${CMAKE_CXX_FLAGS}")
  3. set(flatbuffers_CFLAGS "${CMAKE_CXX_FLAGS}")
  4. set(flatbuffers_LDFLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
  5. else()
  6. set(nlohmann_json_CXXFLAGS "-D_FORTIFY_SOURCE=2 -O2")
  7. set(nlohmann_json_CFLAGS "-D_FORTIFY_SOURCE=2 -O2")
  8. endif()
  9. if(ENABLE_GITEE)
  10. set(REQ_URL "https://gitee.com/mirrors/JSON-for-Modern-CPP/repository/archive/v3.6.1.zip")
  11. set(MD5 "36ea0d9a709c6667b2798a62f6b197ae")
  12. set(INCLUDE "./include")
  13. else()
  14. set(REQ_URL "https://github.com/nlohmann/json/releases/download/v3.6.1/include.zip")
  15. set(MD5 "0dc903888211db3a0f170304cd9f3a89")
  16. set(INCLUDE "./")
  17. endif()
  18. mindspore_add_pkg(nlohmann_json
  19. VER 3.6.1
  20. HEAD_ONLY ${INCLUDE}
  21. URL ${REQ_URL}
  22. MD5 ${MD5})
  23. include_directories(${nlohmann_json_INC})
  24. add_library(mindspore::json ALIAS nlohmann_json)