Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[assimp] update to 5.4.3 and fix build error #40894

Merged
merged 11 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 36 additions & 53 deletions ports/assimp/build_fixes.patch
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 718a251..21d253f 100644
index d45eb22..80353ed 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -291,9 +291,9 @@ ELSEIF(MSVC)
@@ -307,7 +307,7 @@ ELSEIF(MSVC)
ENDIF()
# supress warning for double to float conversion if Double precision is activated
ADD_COMPILE_OPTIONS(/wd4244)
ADD_COMPILE_OPTIONS(/wd4244)
- SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /D_DEBUG /Zi /Od")
- SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
- SET(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG:FULL /PDBALTPATH:%_PDB% /OPT:REF /OPT:ICF")
+ #SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /D_DEBUG /Zi /Od")
+ #SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
+ #SET(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG:FULL /PDBALTPATH:%_PDB% /OPT:REF /OPT:ICF")
ELSEIF (CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
IF(NOT ASSIMP_HUNTER_ENABLED)
SET(CMAKE_POSITION_INDEPENDENT_CODE ON)
@@ -421,7 +421,7 @@ ENDIF()
# Allow user to disable PDBs
if(ASSIMP_INSTALL_PDB)
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi")
JonLiu1993 marked this conversation as resolved.
Show resolved Hide resolved
@@ -444,7 +444,7 @@ ENDIF()

set(GENERATED_DIR "${CMAKE_CURRENT_BINARY_DIR}/generated")

Expand All @@ -24,7 +20,7 @@ index 718a251..21d253f 100644
set(CONFIG_INSTALL_DIR "lib/cmake/${PROJECT_NAME}")
set(CMAKE_CONFIG_TEMPLATE_FILE "cmake-modules/assimp-hunter-config.cmake.in")
set(NAMESPACE "${PROJECT_NAME}::")
@@ -429,7 +429,7 @@ IF(ASSIMP_HUNTER_ENABLED)
@@ -452,7 +452,7 @@ IF(ASSIMP_HUNTER_ENABLED)
set(VERSION_CONFIG "${GENERATED_DIR}/${PROJECT_NAME}ConfigVersion.cmake")
set(PROJECT_CONFIG "${GENERATED_DIR}/${PROJECT_NAME}Config.cmake")
ELSE()
Expand All @@ -33,7 +29,7 @@ index 718a251..21d253f 100644
set(CMAKE_CONFIG_TEMPLATE_FILE "cmake-modules/assimp-plain-config.cmake.in")
string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWERCASE)
set(NAMESPACE "${PROJECT_NAME_LOWERCASE}::")
@@ -473,14 +473,14 @@ ENDIF()
@@ -496,14 +496,14 @@ ENDIF()

# Search for external dependencies, and build them from source if not found
# Search for zlib
Expand All @@ -53,7 +49,7 @@ index 718a251..21d253f 100644
ELSE()
# If the zlib is already found outside, add an export in case assimpTargets can't find it.
IF( ZLIB_FOUND AND ASSIMP_INSTALL)
@@ -525,12 +525,12 @@ ELSE()
@@ -548,12 +548,12 @@ ELSE()
ENDIF()

IF( NOT IOS )
Expand All @@ -76,10 +72,10 @@ index 6551dcb..457fcd7 100644
@PACKAGE_INIT@

+include(CMakeFindDependencyMacro)
+
+find_dependency(kubazip CONFIG)
JonLiu1993 marked this conversation as resolved.
Show resolved Hide resolved
+find_dependency(pugixml CONFIG)
JonLiu1993 marked this conversation as resolved.
Show resolved Hide resolved
+if(NOT @BUILD_SHARED_LIBS@)
+ find_dependency(kubazip CONFIG)
+ #find_dependency(kubazip CONFIG)
+ find_dependency(unofficial-minizip CONFIG)
+ #find_dependency(openddlparser CONFIG)
+ find_dependency(poly2tri CONFIG)
Expand All @@ -93,19 +89,6 @@ index 6551dcb..457fcd7 100644
include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake")

set(ASSIMP_ROOT_DIR ${PACKAGE_PREFIX_DIR})
diff --git a/code/AssetLib/3MF/D3MFExporter.cpp b/code/AssetLib/3MF/D3MFExporter.cpp
index 6caa4c8..c130fcc 100644
--- a/code/AssetLib/3MF/D3MFExporter.cpp
+++ b/code/AssetLib/3MF/D3MFExporter.cpp
@@ -57,7 +57,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifdef ASSIMP_USE_HUNTER
#include <zip/zip.h>
#else
-#include <contrib/zip/src/zip.h>
+#include <zip/zip.h>
#endif

namespace Assimp {
diff --git a/code/AssetLib/Blender/BlenderTessellator.h b/code/AssetLib/Blender/BlenderTessellator.h
index e43535f..a0104c1 100644
--- a/code/AssetLib/Blender/BlenderTessellator.h
Expand Down Expand Up @@ -135,7 +118,7 @@ index d488b23..1a6c0c7 100644
#include <iterator>
#include <memory>
diff --git a/code/AssetLib/IFC/IFCLoader.cpp b/code/AssetLib/IFC/IFCLoader.cpp
index 9414697..48ad145 100644
index 13ea2d4..aeeb311 100644
--- a/code/AssetLib/IFC/IFCLoader.cpp
+++ b/code/AssetLib/IFC/IFCLoader.cpp
@@ -53,7 +53,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Expand Down Expand Up @@ -202,11 +185,11 @@ index d7f512c..94275f1 100644
#include <memory>

diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt
index f4c2936..979e688 100644
index 9b27086..a6db1cb 100644
--- a/code/CMakeLists.txt
+++ b/code/CMakeLists.txt
@@ -922,8 +922,8 @@ SET( Extra_SRCS
SOURCE_GROUP( Extra FILES ${Extra_SRCS})
@@ -1050,8 +1050,8 @@ ELSE() # IF (ASSIMP_BUILD_USD_IMPORTER)
ENDIF() # IF (ASSIMP_BUILD_USD_IMPORTER)

# pugixml
-IF(ASSIMP_HUNTER_ENABLED)
Expand All @@ -216,7 +199,7 @@ index f4c2936..979e688 100644
find_package(pugixml CONFIG REQUIRED)
ELSE()
SET( Pugixml_SRCS
@@ -935,30 +935,30 @@ ELSE()
@@ -1063,30 +1063,30 @@ ELSE()
ENDIF()

# utf8
Expand Down Expand Up @@ -256,7 +239,7 @@ index f4c2936..979e688 100644
SET( Poly2Tri_SRCS
../contrib/poly2tri/poly2tri/common/shapes.cc
../contrib/poly2tri/poly2tri/common/shapes.h
@@ -973,12 +973,12 @@ ENDIF()
@@ -1101,12 +1101,12 @@ ENDIF()
../contrib/poly2tri/poly2tri/sweep/sweep_context.h
)
SOURCE_GROUP( Contrib\\Poly2Tri FILES ${Poly2Tri_SRCS})
Expand All @@ -273,7 +256,7 @@ index f4c2936..979e688 100644
ELSE()
SET( unzip_SRCS
../contrib/unzip/crypt.h
@@ -993,9 +993,9 @@ ENDIF()
@@ -1121,9 +1121,9 @@ ENDIF()
# zip (https://github.com/kuba--/zip)
separate_arguments(ASSIMP_EXPORTERS_LIST UNIX_COMMAND ${ASSIMP_EXPORTERS_ENABLED})
IF(3MF IN_LIST ASSIMP_EXPORTERS_LIST)
Expand All @@ -286,7 +269,7 @@ index f4c2936..979e688 100644
ELSE()
SET( ziplib_SRCS
../contrib/zip/src/miniz.h
@@ -1015,7 +1015,7 @@ IF(3MF IN_LIST ASSIMP_EXPORTERS_LIST)
@@ -1143,7 +1143,7 @@ IF(3MF IN_LIST ASSIMP_EXPORTERS_LIST)
ENDIF()

# openddlparser
Expand All @@ -295,7 +278,7 @@ index f4c2936..979e688 100644
hunter_add_package(openddlparser)
find_package(openddlparser CONFIG REQUIRED)
ELSE()
@@ -1038,7 +1038,7 @@ ELSE()
@@ -1166,7 +1166,7 @@ ELSE()
ENDIF()

# Open3DGC
Expand All @@ -304,15 +287,15 @@ index f4c2936..979e688 100644
# Nothing to do, not available in Hunter yet.
ELSE()
SET ( open3dgc_SRCS
@@ -1073,6 +1073,7 @@ ELSE()
@@ -1201,6 +1201,7 @@ ELSE()
../contrib/Open3DGC/o3dgcVector.inl
)
SOURCE_GROUP( Contrib\\open3dgc FILES ${open3dgc_SRCS})
+ INCLUDE_DIRECTORIES("../contrib")
ENDIF()

# Check dependencies for glTF importer with Open3DGC-compression.
@@ -1081,7 +1082,7 @@ ENDIF()
@@ -1209,7 +1210,7 @@ ENDIF()
IF (NOT WIN32)
FIND_PACKAGE(RT QUIET)
ENDIF ()
Expand All @@ -321,7 +304,7 @@ index f4c2936..979e688 100644
SET( ASSIMP_IMPORTER_GLTF_USE_OPEN3DGC 1 )
ADD_DEFINITIONS( -DASSIMP_IMPORTER_GLTF_USE_OPEN3DGC=1 )
ELSE ()
@@ -1091,9 +1092,10 @@ ELSE ()
@@ -1219,9 +1220,10 @@ ELSE ()
ENDIF ()

# RapidJSON
Expand All @@ -334,7 +317,7 @@ index f4c2936..979e688 100644
ELSE()
INCLUDE_DIRECTORIES("../contrib/rapidjson/include")
ADD_DEFINITIONS( -DRAPIDJSON_HAS_STDSTRING=1)
@@ -1104,9 +1106,9 @@ ELSE()
@@ -1232,9 +1234,9 @@ ELSE()
ENDIF()

# stb
Expand All @@ -343,11 +326,11 @@ index f4c2936..979e688 100644
- find_package(stb CONFIG REQUIRED)
+IF(1)
+ #hunter_add_package(stb)
+ find_package(Stb REQUIRED)
+ find_package(stb REQUIRED)
ELSE()
SET( stb_SRCS
../contrib/stb/stb_image.h
@@ -1128,7 +1130,7 @@ IF( MSVC OR "${CMAKE_CXX_SIMULATE_ID}" MATCHES "MSVC") # clang with MSVC ABI
@@ -1256,7 +1258,7 @@ IF( MSVC OR "${CMAKE_CXX_SIMULATE_ID}" MATCHES "MSVC") # clang with MSVC ABI
ADD_DEFINITIONS( -D_CRT_SECURE_NO_WARNINGS )
endif ()

Expand All @@ -356,7 +339,7 @@ index f4c2936..979e688 100644
if (UNZIP_FOUND)
SET (unzip_compile_SRCS "")
else ()
@@ -1180,7 +1182,7 @@ SET( assimp_src
@@ -1310,7 +1312,7 @@ SET( assimp_src
)
ADD_DEFINITIONS( -DOPENDDLPARSER_BUILD )

Expand All @@ -365,7 +348,7 @@ index f4c2936..979e688 100644
INCLUDE_DIRECTORIES(
${IRRXML_INCLUDE_DIR}
../contrib/openddlparser/include
@@ -1282,45 +1284,48 @@ TARGET_INCLUDE_DIRECTORIES ( assimp PUBLIC
@@ -1412,45 +1414,48 @@ TARGET_INCLUDE_DIRECTORIES ( assimp PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/../include>
$<INSTALL_INTERFACE:${ASSIMP_INCLUDE_INSTALL_DIR}>
Expand Down Expand Up @@ -399,7 +382,7 @@ index f4c2936..979e688 100644
- if(TARGET zip::zip)
- target_link_libraries(assimp PUBLIC zip::zip)
+ if(1)
+ target_link_libraries(assimp PRIVATE kubazip::kubazip)
+ target_link_libraries(assimp PUBLIC kubazip::kubazip)
JonLiu1993 marked this conversation as resolved.
Show resolved Hide resolved
endif()

if (ASSIMP_BUILD_DRACO)
Expand Down Expand Up @@ -431,7 +414,7 @@ index f4c2936..979e688 100644
ENDIF ()

if( MSVC )
@@ -1361,13 +1366,13 @@ if (MINGW)
@@ -1491,13 +1496,13 @@ if (MINGW)
ARCHIVE_OUTPUT_NAME assimp
)
if (NOT BUILD_SHARED_LIBS)
Expand All @@ -447,7 +430,7 @@ index f4c2936..979e688 100644
endif()

SET_TARGET_PROPERTIES( assimp PROPERTIES
@@ -1397,14 +1402,14 @@ ENDIF()
@@ -1527,14 +1532,14 @@ ENDIF()

# Build against external unzip, or add ../contrib/unzip so
# assimp can #include "unzip.h"
Expand All @@ -465,7 +448,7 @@ index f4c2936..979e688 100644
endif()
else ()
INCLUDE_DIRECTORIES("../")
@@ -1413,7 +1418,7 @@ ENDIF()
@@ -1543,7 +1548,7 @@ ENDIF()

# Add RT-extension library for glTF importer with Open3DGC-compression.
IF (RT_FOUND AND ASSIMP_IMPORTER_GLTF_USE_OPEN3DGC)
Expand All @@ -475,10 +458,10 @@ index f4c2936..979e688 100644

IF(ASSIMP_INSTALL)
diff --git a/code/Common/BaseImporter.cpp b/code/Common/BaseImporter.cpp
index 3a4c7c3..f247927 100644
index 5c70cc2..bbbaae0 100644
--- a/code/Common/BaseImporter.cpp
+++ b/code/Common/BaseImporter.cpp
@@ -353,7 +353,7 @@ std::string BaseImporter::GetExtension(const std::string &pFile) {
@@ -354,7 +354,7 @@ std::string BaseImporter::GetExtension(const std::string &pFile) {
return false;
}

Expand All @@ -488,7 +471,7 @@ index 3a4c7c3..f247927 100644
// ------------------------------------------------------------------------------------------------
// Convert to UTF8 data
diff --git a/code/Common/StbCommon.h b/code/Common/StbCommon.h
index aef23ce..3977fde 100644
index aef23ce..1b059ec 100644
--- a/code/Common/StbCommon.h
+++ b/code/Common/StbCommon.h
@@ -53,7 +53,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Expand Down
40 changes: 40 additions & 0 deletions ports/assimp/fix-incompatible.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 80353ed..058922e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -315,8 +315,6 @@ ELSEIF(MSVC)
elseif((GENERATOR_IS_MULTI_CONFIG) OR (CMAKE_BUILD_TYPE MATCHES Release))
message("-- MSVC PDB generation disabled. Release binary will not be debuggable.")
endif()
- # Source code is encoded in UTF-8
- ADD_COMPILE_OPTIONS(/source-charset:utf-8)
ELSEIF (CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
IF(NOT ASSIMP_HUNTER_ENABLED)
SET(CMAKE_POSITION_INDEPENDENT_CODE ON)
diff --git a/code/AssetLib/3MF/D3MFExporter.cpp b/code/AssetLib/3MF/D3MFExporter.cpp
JonLiu1993 marked this conversation as resolved.
Show resolved Hide resolved
index 6c09f09..7b3410a 100644
--- a/code/AssetLib/3MF/D3MFExporter.cpp
+++ b/code/AssetLib/3MF/D3MFExporter.cpp
@@ -57,7 +57,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifdef ASSIMP_USE_HUNTER
#include <zip/zip.h>
#else
-#include <contrib/zip/src/zip.h>
+#include <zip/zip.h>
#endif

namespace Assimp {
diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt
index a6db1cb..22d0652 100644
--- a/code/CMakeLists.txt
+++ b/code/CMakeLists.txt
@@ -1235,8 +1235,7 @@ ENDIF()

# stb
IF(1)
- #hunter_add_package(stb)
- find_package(stb REQUIRED)
+ find_package(Stb REQUIRED)
JonLiu1993 marked this conversation as resolved.
Show resolved Hide resolved
ELSE()
SET( stb_SRCS
../contrib/stb/stb_image.h
3 changes: 2 additions & 1 deletion ports/assimp/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO assimp/assimp
REF "v${VERSION}"
SHA512 4bfcc3a1b5a0cf3f382560564cac67088e13c62500c3c77dcef03811e67debe72ff318f5ed145b204d5017b56cb4293f3fe14b4060ca193813cef42b12eebe9d
SHA512 4738db84068d36face8caf61c0789178fdfc1310fa8e81ffb9b025e14183bde546b784d691c92438ab310a79ab7b75ab62ee0247d5f01e81ddf04fb94b7a9c0b
HEAD_REF master
PATCHES
build_fixes.patch
fix-incompatible.patch
)

file(REMOVE "${SOURCE_PATH}/cmake-modules/FindZLIB.cmake")
Expand Down
2 changes: 1 addition & 1 deletion ports/assimp/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "assimp",
"version": "5.4.2",
"version": "5.4.3",
"description": "The Open Asset import library",
"homepage": "https://github.com/assimp/assimp",
"license": "BSD-3-Clause",
Expand Down
5 changes: 5 additions & 0 deletions versions/a-/assimp.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "af083c985f43b52dddf9b206fe892becb4574c3d",
"version": "5.4.3",
"port-version": 0
},
{
"git-tree": "205e4ca24e9ba331c232e326707c7b84e78c0720",
"version": "5.4.2",
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@
"port-version": 1
},
"assimp": {
"baseline": "5.4.2",
"baseline": "5.4.3",
"port-version": 0
},
"astr": {
Expand Down