mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-18 17:53:03 +08:00
[flatbuffers] upgrade the flatbuffers
to v2.0.0 (#18897)
* upgrade the flatbuffers's version * run `vcpkg x-add-version` * upgrade flatbuffers to v2.0.0 for mnn * add new port-version of `mnn` after upgrade the flatbuffers * fix the port-version of `mnn` * Update ports/mnn/vcpkg.json Co-authored-by: JonLiu1993 <63675417+JonLiu1993@users.noreply.github.com> * Update ports/flatbuffers/CONTROL Co-authored-by: JonLiu1993 <63675417+JonLiu1993@users.noreply.github.com> * run `vcpkg x-add-version flatbuffers --overwrite-version` * run `vcpkg x-add-version mnn --overwrite-version` * regenerate code files by flatc before build * run `vcpkg x-add-version mnn --overwrite-version` * add `flatbuffers` in dependencies * run `vcpkg x-add-version mnn --overwrite-version` * new port version for mnn * run `vcpkg x-add-version mnn --overwrite-version` to rebuild * Update versions/m-/mnn.json Co-authored-by: JonLiu1993 <63675417+JonLiu1993@users.noreply.github.com> * Update ports/mnn/vcpkg.json Co-authored-by: JonLiu1993 <63675417+JonLiu1993@users.noreply.github.com> * run `vcpkg x-add-version mnn --overwrite-version` * Add missing quotes. Co-authored-by: JonLiu1993 <63675417+JonLiu1993@users.noreply.github.com> Co-authored-by: Billy Robert ONeal III <bion@microsoft.com>
This commit is contained in:
parent
10c81db0c9
commit
eea00aaa91
@ -1,6 +1,5 @@
|
||||
Source: flatbuffers
|
||||
Version: 1.12.0
|
||||
Port-Version: 2
|
||||
Version: 2.0.0
|
||||
Description: Memory Efficient Serialization Library
|
||||
FlatBuffers is an efficient cross platform serialization library for games and other memory constrained apps. It allows you to directly access serialized data without unpacking/parsing it first, while still having great forwards/backwards compatibility.
|
||||
Homepage: https://google.github.io/flatbuffers/
|
||||
|
@ -1,23 +0,0 @@
|
||||
diff --git a/include/flatbuffers/flatbuffers.h b/include/flatbuffers/flatbuffers.h
|
||||
index c4dc5bc..c090455 100644
|
||||
--- a/include/flatbuffers/flatbuffers.h
|
||||
+++ b/include/flatbuffers/flatbuffers.h
|
||||
@@ -1861,14 +1861,14 @@ class FlatBufferBuilder {
|
||||
|
||||
/// @cond FLATBUFFERS_INTERNAL
|
||||
template<typename T> struct TableKeyComparator {
|
||||
- TableKeyComparator(vector_downward &buf) : buf_(buf) {}
|
||||
+ TableKeyComparator(vector_downward &buf) : buf_(&buf) {}
|
||||
TableKeyComparator(const TableKeyComparator &other) : buf_(other.buf_) {}
|
||||
bool operator()(const Offset<T> &a, const Offset<T> &b) const {
|
||||
- auto table_a = reinterpret_cast<T *>(buf_.data_at(a.o));
|
||||
- auto table_b = reinterpret_cast<T *>(buf_.data_at(b.o));
|
||||
+ auto table_a = reinterpret_cast<T *>(buf_->data_at(a.o));
|
||||
+ auto table_b = reinterpret_cast<T *>(buf_->data_at(b.o));
|
||||
return table_a->KeyCompareLessThan(table_b);
|
||||
}
|
||||
- vector_downward &buf_;
|
||||
+ vector_downward *buf_;
|
||||
|
||||
private:
|
||||
TableKeyComparator &operator=(const TableKeyComparator &other) {
|
@ -1,8 +1,8 @@
|
||||
diff --git a/src/util.cpp b/src/util.cpp
|
||||
index c1bb197..658e116 100644
|
||||
index 3670a019..fb5d884f 100644
|
||||
--- a/src/util.cpp
|
||||
+++ b/src/util.cpp
|
||||
@@ -245,9 +245,15 @@ bool ReadEnvironmentVariable(const char *var_name, std::string *_value) {
|
||||
@@ -255,9 +255,15 @@ bool ReadEnvironmentVariable(const char *var_name, std::string *_value) {
|
||||
#ifdef _MSC_VER
|
||||
__pragma(warning(disable : 4996)); // _CRT_SECURE_NO_WARNINGS
|
||||
#endif
|
||||
|
@ -1,8 +1,8 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 119855a..945085a 100644
|
||||
index ec782239..f163b64d 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -155,7 +155,7 @@ set(FlatBuffers_GRPCTest_SRCS
|
||||
@@ -216,7 +216,7 @@ set(FlatBuffers_GRPCTest_SRCS
|
||||
# source_group(Compiler FILES ${FlatBuffers_Compiler_SRCS})
|
||||
# source_group(Tests FILES ${FlatBuffers_Tests_SRCS})
|
||||
|
||||
|
@ -1,13 +1,13 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 119855a..6269362 100644
|
||||
index ec782239..57566c5a 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -172,13 +172,17 @@ elseif(CMAKE_COMPILER_IS_GNUCXX)
|
||||
@@ -233,13 +233,17 @@ elseif(CMAKE_COMPILER_IS_GNUCXX)
|
||||
"${CMAKE_CXX_FLAGS} -std=c++0x")
|
||||
endif(CYGWIN)
|
||||
set(CMAKE_CXX_FLAGS
|
||||
- "${CMAKE_CXX_FLAGS} -Wall -pedantic -Werror -Wextra -Werror=shadow")
|
||||
+ "${CMAKE_CXX_FLAGS} -Wall -pedantic -Wextra -Werror=shadow")
|
||||
+ "${CMAKE_CXX_FLAGS} -Wall -pedantic -Wextra -Werror=shadow")
|
||||
set(FLATBUFFERS_PRIVATE_CXX_FLAGS "-Wold-style-cast")
|
||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.4)
|
||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0)
|
||||
|
@ -3,15 +3,13 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO google/flatbuffers
|
||||
REF v1.12.0
|
||||
SHA512 8a0b88d739fa4694a69d3630140fe89fdd70d50bba4dadd1758d9aa2920cda16700bcafb8d89fe2a09ac907d3f378240c3cb4abc7106318136799836aba4b063
|
||||
REF v2.0.0
|
||||
SHA512 26a06b572c0e4c9685743bd2d2162ac7dcd74b9324624cc3f3ef5b154c0cee7c52a04b77cdc184245d2d6ae38dfdcc4fd66001c318aa8ca001d2bf1d85d66a89
|
||||
HEAD_REF master
|
||||
PATCHES
|
||||
ignore_use_of_cmake_toolchain_file.patch
|
||||
no-werror.patch
|
||||
fix-uwp-build.patch
|
||||
fix-issue-6036.patch # this patch is already applied to the latest master branch.
|
||||
# remove it in next version update
|
||||
)
|
||||
|
||||
set(OPTIONS)
|
||||
|
@ -39,6 +39,27 @@ if("cuda" IN_LIST FEATURES)
|
||||
unset(NINJA_OPTION)
|
||||
endif()
|
||||
|
||||
set(FLATC_EXEC ${CURRENT_HOST_INSTALLED_DIR}/tools/flatbuffers/flatc${VCPKG_HOST_EXECUTABLE_SUFFIX})
|
||||
if (NOT EXISTS "${FLATC_EXEC}")
|
||||
message(FATAL_ERROR "Expected ${FLATC_EXEC} to exist.")
|
||||
endif()
|
||||
|
||||
# regenerate some code files by schemes and flatbuffers
|
||||
vcpkg_execute_build_process(
|
||||
COMMAND "${FLATC_EXEC}" "-c" "-b" "--gen-object-api" "--reflect-names"
|
||||
"../default/BasicOptimizer.fbs"
|
||||
"../default/CaffeOp.fbs"
|
||||
"../default/GpuLibrary.fbs"
|
||||
"../default/MNN.fbs"
|
||||
"../default/Tensor.fbs"
|
||||
"../default/TensorflowOp.fbs"
|
||||
"../default/TFQuantizeOp.fbs"
|
||||
"../default/Type.fbs"
|
||||
"../default/UserDefine.fbs"
|
||||
WORKING_DIRECTORY "${SOURCE_PATH}/schema/current/"
|
||||
LOGNAME flatc-${TARGET_TRIPLET}
|
||||
)
|
||||
|
||||
if(VCPKG_TARGET_IS_WINDOWS)
|
||||
string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" USE_RUNTIME_MT)
|
||||
list(APPEND PLATFORM_OPTIONS -DMNN_WIN_RUNTIME_MT=${USE_RUNTIME_MT})
|
||||
@ -65,6 +86,7 @@ vcpkg_download_distfile(COPYRIGHT_PATH
|
||||
FILENAME 98f6b79b778f7b0a1541.txt
|
||||
SHA512 98f6b79b778f7b0a15415bd750c3a8a097d650511cb4ec8115188e115c47053fe700f578895c097051c9bc3dfb6197c2b13a15de203273e1a3218884f86e90e8
|
||||
)
|
||||
|
||||
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share/${PORT})
|
||||
file(RENAME ${COPYRIGHT_PATH} ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright)
|
||||
|
||||
|
@ -1,12 +1,17 @@
|
||||
{
|
||||
"name": "mnn",
|
||||
"version-string": "1.1.0",
|
||||
"version": "1.1.0",
|
||||
"port-version": 1,
|
||||
"description": "MNN is a blazing fast, lightweight deep learning framework, battle-tested by business-critical use cases in Alibaba",
|
||||
"homepage": "https://www.mnn.zone/",
|
||||
"license": "Apache-2.0",
|
||||
"supports": "!(arm | uwp | ios | android)",
|
||||
"dependencies": [
|
||||
"flatbuffers",
|
||||
{
|
||||
"name": "flatbuffers",
|
||||
"host": true
|
||||
},
|
||||
"rapidjson",
|
||||
"stb"
|
||||
],
|
||||
|
@ -2033,8 +2033,8 @@
|
||||
"port-version": 2
|
||||
},
|
||||
"flatbuffers": {
|
||||
"baseline": "1.12.0",
|
||||
"port-version": 2
|
||||
"baseline": "2.0.0",
|
||||
"port-version": 0
|
||||
},
|
||||
"flint": {
|
||||
"baseline": "2.5.2-4",
|
||||
@ -4110,7 +4110,7 @@
|
||||
},
|
||||
"mnn": {
|
||||
"baseline": "1.1.0",
|
||||
"port-version": 0
|
||||
"port-version": 1
|
||||
},
|
||||
"modp-base64": {
|
||||
"baseline": "2020-09-26",
|
||||
|
@ -1,5 +1,10 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "15a2fc0a15331e81cd04a3aae0a8b1d70c002ee5",
|
||||
"version-string": "2.0.0",
|
||||
"port-version": 0
|
||||
},
|
||||
{
|
||||
"git-tree": "195ffbf0b3c6abace9106115fd4ed081431a3997",
|
||||
"version-string": "1.12.0",
|
||||
|
@ -1,5 +1,10 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "10351b13b0daa0e66de483597da63e0d60e9777a",
|
||||
"version": "1.1.0",
|
||||
"port-version": 1
|
||||
},
|
||||
{
|
||||
"git-tree": "491764622aa21728db88d7dd574f430cae600af5",
|
||||
"version-string": "1.1.0",
|
||||
|
Loading…
Reference in New Issue
Block a user