[assimp] Update to 5.2.4 (#24843)

Co-authored-by: Osyotr <8740768+Osyotr@users.noreply.github.com>
Co-authored-by: JackBoosY <yuzaiyang@beyondsoft.com>
This commit is contained in:
Osyotr 2022-07-07 01:00:23 +03:00 committed by GitHub
parent 35fb7a05a7
commit 9776b51b55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 613 additions and 681 deletions

81
ports/assimp/4542.patch Normal file
View File

@ -0,0 +1,81 @@
From affa85a36bbd329c8792b553f64188c1d3a58188 Mon Sep 17 00:00:00 2001
From: hgdagon <hgdagon@gmail.com>
Date: Wed, 25 May 2022 07:59:01 -0700
Subject: [PATCH 1/2] Fix GNUC check on Windows
---
code/Common/DefaultIOStream.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/code/Common/DefaultIOStream.cpp b/code/Common/DefaultIOStream.cpp
index 17fc44f9a2..bbc3b2080f 100644
--- a/code/Common/DefaultIOStream.cpp
+++ b/code/Common/DefaultIOStream.cpp
@@ -63,7 +63,7 @@ inline int select_fseek(FILE *file, int64_t offset, int origin) {
-#if defined _WIN64 && (!defined __GNUC__ || __MSVCRT_VERSION__ >= 0x0601)
+#if defined _WIN32 && !defined __GNUC__ && __MSVCRT_VERSION__ >= 0x0601
template <>
inline size_t select_ftell<8>(FILE *file) {
return (size_t)::_ftelli64(file);
@@ -74,7 +74,7 @@ inline int select_fseek<8>(FILE *file, int64_t offset, int origin) {
return ::_fseeki64(file, offset, origin);
}
-#endif // #if defined _WIN32 && (!defined __GNUC__ || __MSVCRT_VERSION__ >= 0x0601)
+#endif // #if defined _WIN32 && !defined __GNUC__ && __MSVCRT_VERSION__ >= 0x0601
} // namespace
@@ -149,7 +149,7 @@ size_t DefaultIOStream::FileSize() const {
//
// See here for details:
// https://www.securecoding.cert.org/confluence/display/seccode/FIO19-C.+Do+not+use+fseek()+and+ftell()+to+compute+the+size+of+a+regular+file
-#if defined _WIN64 && (!defined __GNUC__ || __MSVCRT_VERSION__ >= 0x0601)
+#if defined _WIN32 && !defined __GNUC__ && __MSVCRT_VERSION__ >= 0x0601
struct __stat64 fileStat;
//using fileno + fstat avoids having to handle the filename
int err = _fstat64(_fileno(mFile), &fileStat);
From efbcdccac99a66d513731a2f5af65211c734cfe7 Mon Sep 17 00:00:00 2001
From: hgdagon <hgdagon@gmail.com>
Date: Wed, 25 May 2022 09:18:42 -0700
Subject: [PATCH 2/2] Fix GNUC check on Windows (2nd attempt)
---
code/Common/DefaultIOStream.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/code/Common/DefaultIOStream.cpp b/code/Common/DefaultIOStream.cpp
index bbc3b2080f..d5d5846897 100644
--- a/code/Common/DefaultIOStream.cpp
+++ b/code/Common/DefaultIOStream.cpp
@@ -63,7 +63,7 @@ inline int select_fseek(FILE *file, int64_t offset, int origin) {
-#if defined _WIN32 && !defined __GNUC__ && __MSVCRT_VERSION__ >= 0x0601
+#if defined _WIN32 && (!defined __GNUC__ || !defined __CLANG__ && __MSVCRT_VERSION__ >= 0x0601)
template <>
inline size_t select_ftell<8>(FILE *file) {
return (size_t)::_ftelli64(file);
@@ -74,7 +74,7 @@ inline int select_fseek<8>(FILE *file, int64_t offset, int origin) {
return ::_fseeki64(file, offset, origin);
}
-#endif // #if defined _WIN32 && !defined __GNUC__ && __MSVCRT_VERSION__ >= 0x0601
+#endif
} // namespace
@@ -149,7 +149,7 @@ size_t DefaultIOStream::FileSize() const {
//
// See here for details:
// https://www.securecoding.cert.org/confluence/display/seccode/FIO19-C.+Do+not+use+fseek()+and+ftell()+to+compute+the+size+of+a+regular+file
-#if defined _WIN32 && !defined __GNUC__ && __MSVCRT_VERSION__ >= 0x0601
+#if defined _WIN32 && (!defined __GNUC__ || !defined __CLANG__ && __MSVCRT_VERSION__ >= 0x0601)
struct __stat64 fileStat;
//using fileno + fstat avoids having to handle the filename
int err = _fstat64(_fileno(mFile), &fileStat);

File diff suppressed because it is too large Load Diff

View File

@ -1,61 +0,0 @@
diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt
index f5553e5..5cffa0c 100644
--- a/code/CMakeLists.txt
+++ b/code/CMakeLists.txt
@@ -862,7 +862,7 @@ SET( Extra_SRCS
SOURCE_GROUP( Extra FILES ${Extra_SRCS})
# irrXML
- find_package(irrXML CONFIG REQUIRED)
+ find_package(irrlicht CONFIG REQUIRED)
# polyclipping
find_package(polyclipping CONFIG REQUIRED)
@@ -1033,7 +1033,7 @@ TARGET_INCLUDE_DIRECTORIES ( assimp PUBLIC
TARGET_LINK_LIBRARIES(assimp
polyclipping::polyclipping
- irrXML::irrXML
+ Irrlicht
minizip::minizip
ZLIB::ZLIB
kubazip::kubazip
diff --git a/code/X3D/FIReader.cpp b/code/X3D/FIReader.cpp
index 525a084..0cbca48 100644
--- a/code/X3D/FIReader.cpp
+++ b/code/X3D/FIReader.cpp
@@ -654,8 +654,8 @@ public:
return currentNodeType;
}
- virtual int getAttributeCount() const /*override*/ {
- return static_cast<int>(attributes.size());
+ virtual unsigned int getAttributeCount() const /*override*/ {
+ return static_cast<unsigned int>(attributes.size());
}
virtual const char* getAttributeName(int idx) const /*override*/ {
@@ -1733,7 +1733,7 @@ public:
return reader->getNodeType();
}
- virtual int getAttributeCount() const /*override*/ {
+ virtual unsigned int getAttributeCount() const /*override*/ {
return reader->getAttributeCount();
}
diff --git a/include/assimp/irrXMLWrapper.h b/include/assimp/irrXMLWrapper.h
index 77cfd5e..ba584a0 100644
--- a/include/assimp/irrXMLWrapper.h
+++ b/include/assimp/irrXMLWrapper.h
@@ -133,8 +133,8 @@ public:
// ----------------------------------------------------------------------------------
//! Returns size of file in bytes
- virtual int getSize() {
- return (int)data.size();
+ virtual long getSize() const override {
+ return (long)data.size();
}
private:

View File

@ -1,51 +1,51 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO assimp/assimp
REF 8f0c6b04b2257a520aaab38421b2e090204b69df # v5.0.1
SHA512 59b213428e2f7494cb5da423e6b2d51556318f948b00cea420090d74d4f5f0f8970d38dba70cd47b2ef35a1f57f9e15df8597411b6cd8732b233395080147c0f
REF v5.2.4
SHA512 ee988b1806b46c78f97bb5b25237a3f56a7028ed37898fb9b243e379e29e8bfd29e4dffc616566941ed9bdcf502bd30568904ad2ef2ef7d0f63b40daefdc66bf
HEAD_REF master
PATCHES
build_fixes.patch
irrlicht.patch
4542.patch # https://github.com/assimp/assimp/pull/4542
)
file(REMOVE ${SOURCE_PATH}/cmake-modules/FindZLIB.cmake)
file(REMOVE ${SOURCE_PATH}/cmake-modules/FindIrrXML.cmake)
#file(REMOVE_RECURSE ${SOURCE_PATH}/contrib/clipper) # https://github.com/assimp/assimp/issues/788
file(REMOVE_RECURSE ${SOURCE_PATH}/contrib/poly2tri)
file(REMOVE_RECURSE ${SOURCE_PATH}/contrib/zlib)
file(REMOVE_RECURSE ${SOURCE_PATH}/contrib/gtest)
file(REMOVE_RECURSE ${SOURCE_PATH}/contrib/irrXML)
file(REMOVE_RECURSE ${SOURCE_PATH}/contrib/rapidjson)
file(REMOVE_RECURSE ${SOURCE_PATH}/contrib/stb_image)
file(REMOVE_RECURSE ${SOURCE_PATH}/contrib/zip)
file(REMOVE_RECURSE ${SOURCE_PATH}/contrib/unzip)
file(REMOVE_RECURSE ${SOURCE_PATH}/contrib/utf8cpp)
#file(REMOVE_RECURSE ${SOURCE_PATH}/contrib/Open3DGC) #TODO
#file(REMOVE_RECURSE ${SOURCE_PATH}/contrib/openddlparser) #TODO
file(REMOVE "${SOURCE_PATH}/cmake-modules/FindZLIB.cmake")
#file(REMOVE_RECURSE "${SOURCE_PATH}/contrib/clipper") # https://github.com/assimp/assimp/issues/788
file(REMOVE_RECURSE "${SOURCE_PATH}/contrib/draco")
file(REMOVE_RECURSE "${SOURCE_PATH}/contrib/gtest")
#file(REMOVE_RECURSE "${SOURCE_PATH}/contrib/Open3DGC") #TODO
#file(REMOVE_RECURSE "${SOURCE_PATH}/contrib/openddlparser") #TODO
file(REMOVE_RECURSE "${SOURCE_PATH}/contrib/poly2tri")
file(REMOVE_RECURSE "${SOURCE_PATH}/contrib/pugixml")
file(REMOVE_RECURSE "${SOURCE_PATH}/contrib/rapidjson")
file(REMOVE_RECURSE "${SOURCE_PATH}/contrib/stb")
file(REMOVE_RECURSE "${SOURCE_PATH}/contrib/unzip")
file(REMOVE_RECURSE "${SOURCE_PATH}/contrib/utf8cpp")
file(REMOVE_RECURSE "${SOURCE_PATH}/contrib/zip")
file(REMOVE_RECURSE "${SOURCE_PATH}/contrib/zlib")
set(VCPKG_C_FLAGS "${VCPKG_C_FLAGS} -D_CRT_SECURE_NO_WARNINGS")
set(VCPKG_CXX_FLAGS "${VCPKG_CXX_FLAGS} -D_CRT_SECURE_NO_WARNINGS")
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" ASSIMP_BUILD_SHARED_LIBS)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS -DASSIMP_BUILD_TESTS=OFF
-DASSIMP_BUILD_ASSIMP_VIEW=OFF
-DASSIMP_BUILD_ZLIB=OFF
-DASSIMP_BUILD_SHARED_LIBS=${ASSIMP_BUILD_SHARED_LIBS}
-DASSIMP_BUILD_ASSIMP_TOOLS=OFF
-DASSIMP_INSTALL_PDB=OFF
-DSYSTEM_IRRXML=ON
-DIGNORE_GIT_HASH=ON
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DASSIMP_BUILD_ZLIB=OFF
-DASSIMP_BUILD_ASSIMP_TOOLS=OFF
-DASSIMP_BUILD_TESTS=OFF
-DASSIMP_WARNINGS_AS_ERRORS=OFF
-DASSIMP_IGNORE_GIT_HASH=ON
-DASSIMP_INSTALL_PDB=OFF
)
vcpkg_install_cmake()
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/assimp")
vcpkg_copy_pdbs()
if(VCPKG_TARGET_IS_WINDOWS)
set(VCVER vc140 vc141 vc142 )
set(VCVER vc140 vc141 vc142 vc143)
set(CRT mt md)
set(DBG_NAMES)
set(REL_NAMES)
@ -67,24 +67,9 @@ if(ASSIMP_DBG)
get_filename_component(ASSIMP_NAME_DBG "${ASSIMP_DBG}" NAME_WLE)
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/assimp.pc" "-lassimp" "-l${ASSIMP_NAME_DBG}")
endif()
vcpkg_fixup_cmake_targets()
vcpkg_fixup_pkgconfig() # Probably requires more fixing for static builds. See qt5-3d and the config changes below
vcpkg_copy_pdbs()
file(READ ${CURRENT_PACKAGES_DIR}/share/assimp/assimpConfig.cmake ASSIMP_CONFIG)
file(WRITE ${CURRENT_PACKAGES_DIR}/share/assimp/assimpConfig.cmake "
include(CMakeFindDependencyMacro)
find_dependency(ZLIB)
find_dependency(irrlicht CONFIG)
find_dependency(polyclipping CONFIG)
find_dependency(minizip CONFIG)
find_dependency(kubazip CONFIG)
find_dependency(poly2tri CONFIG)
find_dependency(utf8cpp CONFIG)
${ASSIMP_CONFIG}")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

View File

@ -1,18 +1,26 @@
{
"name": "assimp",
"version-string": "5.0.1",
"port-version": 5,
"version": "5.2.4",
"description": "The Open Asset import library",
"homepage": "https://github.com/assimp/assimp",
"license": "BSD-3-Clause",
"dependencies": [
"irrlicht",
"draco",
"kubazip",
"minizip",
"poly2tri",
"polyclipping",
"pugixml",
"rapidjson",
"stb",
"utfcpp",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
},
"zlib"
]
}

View File

@ -28,13 +28,10 @@ find_library(LIBPNG_REL NAMES png16 libpng16 PATHS "${CURRENT_INSTALLED_DIR}/lib
find_library(LIBPNG_DBG NAMES png16 png16d libpng16 libpng16d PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH)
find_library(ZLIB_REL NAMES z zlib PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH)
find_library(ZLIB_DBG NAMES z zlib zd zlibd PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH)
find_library(IRRLICHT_REL NAMES Irrlicht PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH)
find_library(IRRLICHT_DBG NAMES Irrlicht PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH)
find_library(POLYCLIPPING_REL NAMES polyclipping PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH)
find_library(POLYCLIPPING_DBG NAMES polyclipping polyclippingd PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH)
find_library(PUGIXML_REL NAMES pugixml PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH)
find_library(PUGIXML_DBG NAMES pugixml pugixmld PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH)
find_library(POLY2TRI_REL NAMES poly2tri PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH)
find_library(POLY2TRI_DBG NAMES poly2tri poly2trid PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH)
# poly2tri
find_library(BZ2_REL bz2 PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH)
find_library(BZ2_DBG bz2 bz2d PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH)
if(BZ2_REL)
@ -50,7 +47,7 @@ elseif(VCPKG_TARGET_IS_OSX)
else()
set(SYSTEM_LIBS "-lGL -lXxf86vm -lX11")
endif()
set(OPT_REL "ASSIMP_LIBS=${ASSIMP_REL} ${POLYCLIPPING_REL} ${POLY2TRI_REL} ${IRRLICHT_REL} ${JPEG_REL} ${LIBPNG_REL} ${KUBAZIP_REL} ${MINIZIP_REL} ${ZLIB_REL} ${SYSTEM_LIBS}")
set(OPT_DBG "ASSIMP_LIBS=${ASSIMP_DBG} ${POLYCLIPPING_DBG} ${POLY2TRI_DBG} ${IRRLICHT_DBG} ${JPEG_DBG} ${LIBPNG_DBG} ${KUBAZIP_DBG} ${MINIZIP_DBG} ${ZLIB_DBG} ${SYSTEM_LIBS}")
set(OPT_REL "ASSIMP_LIBS=${ASSIMP_REL} ${PUGIXML_REL} ${POLY2TRI_REL} ${JPEG_REL} ${LIBPNG_REL} ${KUBAZIP_REL} ${MINIZIP_REL} ${ZLIB_REL} ${SYSTEM_LIBS}")
set(OPT_DBG "ASSIMP_LIBS=${ASSIMP_DBG} ${PUGIXML_DBG} ${POLY2TRI_DBG} ${JPEG_DBG} ${LIBPNG_DBG} ${KUBAZIP_DBG} ${MINIZIP_DBG} ${ZLIB_DBG} ${SYSTEM_LIBS}")
qt_submodule_installation(BUILD_OPTIONS ${OPTIONS} BUILD_OPTIONS_RELEASE ${OPT_REL} BUILD_OPTIONS_DEBUG ${OPT_DBG})

View File

@ -1,6 +1,7 @@
{
"name": "qt5-3d",
"version": "5.15.5",
"port-version": 1,
"description": "Qt5 3d Module - Functionality for near-realtime simulation systems with support for 2D and 3D rendering",
"license": null,
"dependencies": [

View File

@ -1,6 +1,7 @@
{
"name": "qtquick3d",
"version": "6.3.1",
"port-version": 1,
"description": "A new module and API for defining 3D content in Qt Quick.",
"homepage": "https://www.qt.io/",
"license": null,
@ -26,7 +27,6 @@
],
"features": {
"assimp": {
"$comment": "feature assimp requires a newer version of assimp than available within vcpkg. Install assimp with e.g. --head or use an overlay",
"description": "assimp",
"dependencies": [
"assimp"

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "28eaf490bb2eaaf52c344b8e8dc16d4619cb863e",
"version": "5.2.4",
"port-version": 0
},
{
"git-tree": "cab54d6dedc48fcb9642f5fbe079e61105405543",
"version-string": "5.0.1",

View File

@ -201,8 +201,8 @@
"port-version": 1
},
"assimp": {
"baseline": "5.0.1",
"port-version": 5
"baseline": "5.2.4",
"port-version": 0
},
"asynch": {
"baseline": "2019-09-21",
@ -5746,7 +5746,7 @@
},
"qt5-3d": {
"baseline": "5.15.5",
"port-version": 0
"port-version": 1
},
"qt5-activeqt": {
"baseline": "5.15.5",
@ -6006,7 +6006,7 @@
},
"qtquick3d": {
"baseline": "6.3.1",
"port-version": 0
"port-version": 1
},
"qtquickcontrols2": {
"baseline": "deprecated",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "47a71a5fc9720cda647f0d1693f95024b434b5d3",
"version": "5.15.5",
"port-version": 1
},
{
"git-tree": "bdd0dea463c7b380c2747fcd45336712c4a381a5",
"version": "5.15.5",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "cd80e49b7976333f599d55bd5b186b2605f17700",
"version": "6.3.1",
"port-version": 1
},
{
"git-tree": "c3b68a69ca91b7485ada2416293d0a9447d0ba95",
"version": "6.3.1",