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