!40753 update JSON for Modern C++ to 3.10.1

Merge pull request !40753 from yanghaoran/master
This commit is contained in:
i-robot 2022-08-30 06:36:03 +00:00 committed by Gitee
commit 3d4f5a9d68
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 12 additions and 81 deletions

View File

@ -3,24 +3,25 @@ if(MSVC)
set(flatbuffers_CFLAGS "${CMAKE_CXX_FLAGS}")
set(flatbuffers_LDFLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
else()
set(nlohmann_json373_CXXFLAGS "-D_FORTIFY_SOURCE=2 -O2")
set(nlohmann_json373_CFLAGS "-D_FORTIFY_SOURCE=2 -O2")
set(nlohmann_json3101_CXXFLAGS "-D_FORTIFY_SOURCE=2 -O2")
set(nlohmann_json3101_CFLAGS "-D_FORTIFY_SOURCE=2 -O2")
endif()
if(ENABLE_GITEE)
set(REQ_URL "https://gitee.com/mirrors/JSON-for-Modern-CPP/repository/archive/v3.7.3.zip")
set(MD5 "b758acca4f3e133bacf919e31ca302e3")
set(REQ_URL "https://gitee.com/mirrors/JSON-for-Modern-CPP/repository/archive/v3.10.1.zip")
set(MD5 "a402ee7412bd6c7fcb994946ff977c44")
set(INCLUDE "./include")
else()
set(REQ_URL "https://github.com/nlohmann/json/releases/download/v3.7.3/include.zip")
set(MD5 "fb96f95cdf609143e998db401ca4f324")
set(REQ_URL "https://github.com/nlohmann/json/releases/download/v3.10.1/include.zip")
set(MD5 "990b11a4fd9e1b05be02959a439fd402")
set(INCLUDE "./include")
endif()
mindspore_add_pkg(nlohmann_json373
VER 3.7.3
mindspore_add_pkg(nlohmann_json3101
VER 3.10.1
HEAD_ONLY ${INCLUDE}
URL ${REQ_URL}
MD5 ${MD5})
include_directories(${nlohmann_json373_INC})
add_library(mindspore::json ALIAS nlohmann_json373)
include_directories(${nlohmann_json3101_INC})
add_library(mindspore::json ALIAS nlohmann_json3101)

View File

@ -34,7 +34,7 @@
#include "include/api/dual_abi_helper.h"
#include "include/api/types.h"
#include "include/dataset/iterator.h"
#include "include/dataset/json_fwd.hpp"
#include "nlohmann/json_fwd.hpp"
#include "include/dataset/samplers.h"
#include "include/dataset/text.h"

View File

@ -1,70 +0,0 @@
/**
* Copyright 2021 Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef INCLUDE_NLOHMANN_JSON_FWD_HPP_
#define INCLUDE_NLOHMANN_JSON_FWD_HPP_
#include <string>
/*!
@brief namespace for Niels Lohmann
@see https://github.com/nlohmann
@since version 1.0.0
*/
namespace nlohmann {
/*!
@brief default JSONSerializer template argument
This serializer ignores the template arguments and uses ADL
([argument-dependent lookup](https://en.cppreference.com/w/cpp/language/adl))
for serialization.
*/
template <typename T = void, typename SFINAE = void>
struct adl_serializer;
template <template <typename U, typename V, typename... Args> class ObjectType = std::map,
template <typename U, typename... Args> class ArrayType = std::vector, class StringType = std::string,
class BooleanType = bool, class NumberIntegerType = std::int64_t, class NumberUnsignedType = std::uint64_t,
class NumberFloatType = double, template <typename U> class AllocatorType = std::allocator,
template <typename T, typename SFINAE = void> class JSONSerializer = adl_serializer>
class basic_json;
/*!
@brief JSON Pointer
A JSON pointer defines a string syntax for identifying a specific value
within a JSON document. It can be used with functions `at` and
`operator[]`. Furthermore, JSON pointers are the base for JSON patches.
@sa [RFC 6901](https://tools.ietf.org/html/rfc6901)
@since version 2.0.0
*/
template <typename BasicJsonType>
class json_pointer;
/*!
@brief default JSON class
This type is the default specialization of the @ref basic_json class which
uses the standard template types.
@since version 1.0.0
*/
using json = basic_json<>;
} // namespace nlohmann
#endif // INCLUDE_NLOHMANN_JSON_FWD_HPP_