2021-07-31 10:46:37 +08:00
|
|
|
if(MSVC)
|
|
|
|
set(flatbuffers_CXXFLAGS "${CMAKE_CXX_FLAGS}")
|
|
|
|
set(flatbuffers_CFLAGS "${CMAKE_CXX_FLAGS}")
|
|
|
|
set(flatbuffers_LDFLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
|
|
|
|
else()
|
|
|
|
set(nlohmann_json_CXXFLAGS "-D_FORTIFY_SOURCE=2 -O2")
|
|
|
|
set(nlohmann_json_CFLAGS "-D_FORTIFY_SOURCE=2 -O2")
|
|
|
|
endif()
|
2020-10-14 19:35:13 +08:00
|
|
|
|
2021-01-23 20:20:31 +08:00
|
|
|
if(ENABLE_GITEE)
|
2020-10-14 19:35:13 +08:00
|
|
|
set(REQ_URL "https://gitee.com/mirrors/JSON-for-Modern-CPP/repository/archive/v3.6.1.zip")
|
2021-08-08 18:55:53 +08:00
|
|
|
set(MD5 "36ea0d9a709c6667b2798a62f6b197ae")
|
2020-10-16 19:11:02 +08:00
|
|
|
set(INCLUDE "./include")
|
2020-10-14 19:35:13 +08:00
|
|
|
else()
|
|
|
|
set(REQ_URL "https://github.com/nlohmann/json/releases/download/v3.6.1/include.zip")
|
|
|
|
set(MD5 "0dc903888211db3a0f170304cd9f3a89")
|
2020-10-16 19:11:02 +08:00
|
|
|
set(INCLUDE "./")
|
2021-01-23 20:20:31 +08:00
|
|
|
endif()
|
2020-10-14 19:35:13 +08:00
|
|
|
|
2020-03-27 14:49:12 +08:00
|
|
|
mindspore_add_pkg(nlohmann_json
|
|
|
|
VER 3.6.1
|
2020-10-16 19:11:02 +08:00
|
|
|
HEAD_ONLY ${INCLUDE}
|
2020-10-14 19:35:13 +08:00
|
|
|
URL ${REQ_URL}
|
|
|
|
MD5 ${MD5})
|
2020-03-27 14:49:12 +08:00
|
|
|
include_directories(${nlohmann_json_INC})
|
2021-08-08 18:55:53 +08:00
|
|
|
add_library(mindspore::json ALIAS nlohmann_json)
|