Commit ee996bf4 authored by Maki's avatar Maki 🌺
Browse files

Updated draco to fix gcc 11 bugs

parent 9e6d747f
Pipeline #1424 passed with stage
in 28 minutes and 37 seconds
macro(TARGET_DRACO)
set(LIBS draco dracodec dracoenc)
if (ANDROID)
set(LIBS draco dracodec dracoenc)
else()
set(LIBS draco)
endif()
find_library(LIBPATH ${LIB} PATHS )
if (ANDROID)
set(INSTALL_DIR ${HIFI_ANDROID_PRECOMPILED}/draco)
set(DRACO_INCLUDE_DIRS "${INSTALL_DIR}/include" CACHE STRING INTERNAL)
......
......@@ -15,12 +15,13 @@ set(VCPKG_CXX_FLAGS "${VCPKG_CXX_FLAGS} -D_CRT_SECURE_NO_WARNINGS")
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" ASSIMP_BUILD_SHARED_LIBS)
find_library(DRACO_0_LIBRARY draco PATHS ${CURRENT_INSTALLED_DIR}/lib NO_DEFAULT_PATH)
find_library(DRACO_1_LIBRARY dracoenc PATHS ${CURRENT_INSTALLED_DIR}/lib NO_DEFAULT_PATH)
find_library(DRACO_2_LIBRARY dracodec PATHS ${CURRENT_INSTALLED_DIR}/lib NO_DEFAULT_PATH)
find_library(DRACO_LIBRARY draco PATHS ${CURRENT_INSTALLED_DIR}/lib NO_DEFAULT_PATH)
# find_library(DRACO_0_LIBRARY draco PATHS ${CURRENT_INSTALLED_DIR}/lib NO_DEFAULT_PATH)
# find_library(DRACO_1_LIBRARY dracoenc PATHS ${CURRENT_INSTALLED_DIR}/lib NO_DEFAULT_PATH)
# find_library(DRACO_2_LIBRARY dracodec PATHS ${CURRENT_INSTALLED_DIR}/lib NO_DEFAULT_PATH)
set(DRACO_LIBRARY "")
list(APPEND DRACO_LIBRARY ${DRACO_0_LIBRARY} ${DRACO_1_LIBRARY} ${DRACO_2_LIBRARY})
# set(DRACO_LIBRARY "")
# list(APPEND DRACO_LIBRARY ${DRACO_0_LIBRARY} ${DRACO_1_LIBRARY} ${DRACO_2_LIBRARY})
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
......
diff --git a/src/draco/io/parser_utils.cc b/src/draco/io/parser_utils.cc
index 6e42a58..3c302b9 100644
--- a/src/draco/io/parser_utils.cc
+++ b/src/draco/io/parser_utils.cc
@@ -152,7 +152,9 @@ bool ParseSignedInt(DecoderBuffer *buffer, int32_t *value) {
if (!ParseUnsignedInt(buffer, &v)) {
return false;
}
- *value = (sign < 0) ? -v : v;
+ if (sign < 0)
+ v *= -1;
+ *value = v;
return true;
}
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7e79da7..c4d9880 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -70,6 +70,10 @@ draco_set_build_definitions()
draco_set_cxx_flags()
draco_generate_features_h()
+if (MSVC)
+ add_compile_options(/wd4996)
+endif()
+
# Draco source file listing variables.
list(APPEND draco_attributes_sources
"${draco_src_root}/attributes/attribute_octahedron_transform.cc"
diff --git a/src/draco/core/bit_utils.h b/src/draco/core/bit_utils.h
index a102095..b6ba69b 100644
--- a/src/draco/core/bit_utils.h
+++ b/src/draco/core/bit_utils.h
@@ -27,6 +27,8 @@
#include <intrin.h>
#endif // defined(_MSC_VER)
+#pragma warning(disable:4146)
+
namespace draco {
// Returns the number of '1' bits within the input 32 bit integer.
......@@ -3,10 +3,12 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO google/draco
REF 1.3.5
SHA512 f99fcbec60fbd1683d8aacc35ff8ad9ee1c84374132ad4cc8c0f56662f5d33f940f89028cf3e577cde3314fd0766c124f61798121e4127e888f302e9efe1a004
REF 1.4.3
SHA512 f2220d5e84a4ca2d14c6bbc3dca0a2ed5c988849d3a98ce3dea910efe005e0ccdff06677d782cdb1673db9e158905aa91a9305432dc5621e8947b2d90f5996d3
HEAD_REF master
PATCHES signed-unsigned-mismatch.patch
PATCHES
fix-compile-error-uwp.patch
fix-uwperror.patch
)
vcpkg_configure_cmake(
......@@ -16,8 +18,8 @@ vcpkg_configure_cmake(
vcpkg_install_cmake()
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/draco/cmake)
vcpkg_fixup_cmake_targets(CONFIG_PATH share/cmake)
vcpkg_fixup_pkgconfig()
# Install tools and plugins
file(GLOB TOOLS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/*.exe")
if(TOOLS)
......@@ -26,10 +28,7 @@ if(TOOLS)
endif()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/draco)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/draco)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
......
diff --git a/src/draco/mesh/mesh.h b/src/draco/mesh/mesh.h
index b8ca535..024d4e6 100644
--- a/src/draco/mesh/mesh.h
+++ b/src/draco/mesh/mesh.h
@@ -93,7 +93,7 @@ class Mesh : public PointCloud {
// Returns the point id of for a corner |ci|.
inline PointIndex CornerToPointId(int ci) const {
- if (ci == kInvalidCornerIndex.value())
+ if ((uint32_t)ci == kInvalidCornerIndex.value())
return kInvalidPointIndex;
return this->face(FaceIndex(ci / 3))[ci % 3];
}
diff --git a/src/draco/metadata/geometry_metadata.h b/src/draco/metadata/geometry_metadata.h
index 9f668f7..3c6e6a9 100644
--- a/src/draco/metadata/geometry_metadata.h
+++ b/src/draco/metadata/geometry_metadata.h
@@ -65,7 +65,7 @@ class GeometryMetadata : public Metadata {
void DeleteAttributeMetadataByUniqueId(int32_t att_unique_id) {
for (auto itr = att_metadatas_.begin(); itr != att_metadatas_.end();
++itr) {
- if (itr->get()->att_unique_id() == att_unique_id) {
+ if (itr->get()->att_unique_id() == (uint32_t)att_unique_id) {
att_metadatas_.erase(itr);
return;
}
@@ -77,7 +77,7 @@ class GeometryMetadata : public Metadata {
// TODO(draco-eng): Consider using unordered_map instead of vector to store
// attribute metadata.
for (auto &&att_metadata : att_metadatas_) {
- if (att_metadata->att_unique_id() == att_unique_id) {
+ if (att_metadata->att_unique_id() == (uint32_t)att_unique_id) {
return att_metadata.get();
}
}
@@ -88,7 +88,7 @@ class GeometryMetadata : public Metadata {
// TODO(draco-eng): Consider use unordered_map instead of vector to store
// attribute metadata.
for (auto &&att_metadata : att_metadatas_) {
- if (att_metadata->att_unique_id() == att_unique_id) {
+ if (att_metadata->att_unique_id() == (uint32_t)att_unique_id) {
return att_metadata.get();
}
}
{
"name": "draco",
"version-string": "1.3.5",
"description": "A library for compressing and decompressing 3D geometric meshes and point clouds. It is intended to improve the storage and transmission of 3D graphics.",
"version": "1.4.1",
"description": " A library for compressing and decompressing 3D geometric meshes and point clouds. It is intended to improve the storage and transmission of 3D graphics.",
"homepage": "https://github.com/google/draco"
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment