Skip to content

Commit

Permalink
Work around compilation error on Android
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed Dec 6, 2024
1 parent 07e9cca commit 87a6914
Show file tree
Hide file tree
Showing 3 changed files with 135 additions and 0 deletions.
64 changes: 64 additions & 0 deletions vcpkg/ports/qtquick3d/0001-devendor-meshoptimizer.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
diff --git a/src/utils/CMakeLists.txt b/src/utils/CMakeLists.txt
index 78ad8af..bee1ca6 100644
--- a/src/utils/CMakeLists.txt
+++ b/src/utils/CMakeLists.txt
@@ -7,6 +7,8 @@
## Quick3DUtils Module:
#####################################################################

+qt_find_package(meshoptimizer PROVIDED_TARGETS meshoptimizer::meshoptimizer)
+
qt_internal_add_module(Quick3DUtils
SOURCES
qqsbcollection.cpp qqsbcollection_p.h
@@ -26,49 +28,17 @@ qt_internal_add_module(Quick3DUtils
qquick3dprofiler_p.h
../3rdparty/xatlas/xatlas.cpp ../3rdparty/xatlas/xatlas.h
qssglightmapuvgenerator.cpp qssglightmapuvgenerator_p.h
- ../3rdparty/meshoptimizer/src/allocator.cpp
- ../3rdparty/meshoptimizer/src/clusterizer.cpp
- ../3rdparty/meshoptimizer/src/indexcodec.cpp
- ../3rdparty/meshoptimizer/src/indexgenerator.cpp
- ../3rdparty/meshoptimizer/src/meshoptimizer.h
- ../3rdparty/meshoptimizer/src/overdrawanalyzer.cpp
- ../3rdparty/meshoptimizer/src/overdrawoptimizer.cpp
- ../3rdparty/meshoptimizer/src/simplifier.cpp
- ../3rdparty/meshoptimizer/src/spatialorder.cpp
- ../3rdparty/meshoptimizer/src/stripifier.cpp
- ../3rdparty/meshoptimizer/src/vcacheanalyzer.cpp
- ../3rdparty/meshoptimizer/src/vcacheoptimizer.cpp
- ../3rdparty/meshoptimizer/src/vertexcodec.cpp
- ../3rdparty/meshoptimizer/src/vertexfilter.cpp
- ../3rdparty/meshoptimizer/src/vfetchanalyzer.cpp
- ../3rdparty/meshoptimizer/src/vfetchoptimizer.cpp
NO_UNITY_BUILD_SOURCES
../3rdparty/xatlas/xatlas.cpp ../3rdparty/xatlas/xatlas.h
- ../3rdparty/meshoptimizer/src/allocator.cpp
- ../3rdparty/meshoptimizer/src/clusterizer.cpp
- ../3rdparty/meshoptimizer/src/indexcodec.cpp
- ../3rdparty/meshoptimizer/src/indexgenerator.cpp
- ../3rdparty/meshoptimizer/src/meshoptimizer.h
- ../3rdparty/meshoptimizer/src/overdrawanalyzer.cpp
- ../3rdparty/meshoptimizer/src/overdrawoptimizer.cpp
- ../3rdparty/meshoptimizer/src/simplifier.cpp
- ../3rdparty/meshoptimizer/src/spatialorder.cpp
- ../3rdparty/meshoptimizer/src/stripifier.cpp
- ../3rdparty/meshoptimizer/src/vcacheanalyzer.cpp
- ../3rdparty/meshoptimizer/src/vcacheoptimizer.cpp
- ../3rdparty/meshoptimizer/src/vertexcodec.cpp
- ../3rdparty/meshoptimizer/src/vertexfilter.cpp
- ../3rdparty/meshoptimizer/src/vfetchanalyzer.cpp
- ../3rdparty/meshoptimizer/src/vfetchoptimizer.cpp
DEFINES
QT_BUILD_QUICK3DUTILS_LIB
INCLUDE_DIRECTORIES
../3rdparty/xatlas
- ../3rdparty/meshoptimizer/src/
LIBRARIES
Qt::CorePrivate
Qt::GuiPrivate
Qt::QuickPrivate
+ meshoptimizer::meshoptimizer
PUBLIC_LIBRARIES
Qt::Core
Qt::Gui
31 changes: 31 additions & 0 deletions vcpkg/ports/qtquick3d/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
set(SCRIPT_PATH "${CURRENT_INSTALLED_DIR}/share/qtbase")
set(${PORT}_PATCHES 0001-devendor-meshoptimizer.patch)

include("${SCRIPT_PATH}/qt_install_submodule.cmake")

# General features:
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
"assimp" FEATURE_quick3d_assimp
#"assimp" CMAKE_REQUIRE_FIND_PACKAGE_WrapQuick3DAssimp
INVERTED_FEATURES
"assimp" CMAKE_DISABLE_FIND_PACKAGE_WrapQuick3DAssimp
)

if("assimp" IN_LIST FEATURES)
list(APPEND FEATURE_OPTIONS -DINPUT_quick3d_assimp=system -DTEST_quick3d_assimp=ON -DHAVE_Assimp=ON)
else()
list(APPEND FEATURE_OPTIONS -DINPUT_quick3d_assimp=no)
endif()

set(TOOL_NAMES balsam balsamui meshdebug shadergen instancer materialeditor shapegen)

qt_install_submodule(PATCHES ${${PORT}_PATCHES}
TOOL_NAMES ${TOOL_NAMES}
CONFIGURE_OPTIONS
${FEATURE_OPTIONS}
-DQT_FEATURE_quick3dxr_openxr=OFF
-DCMAKE_FIND_PACKAGE_TARGETS_GLOBAL=ON
CONFIGURE_OPTIONS_RELEASE
CONFIGURE_OPTIONS_DEBUG
)
40 changes: 40 additions & 0 deletions vcpkg/ports/qtquick3d/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"name": "qtquick3d",
"version": "6.8.0",
"port-version": 1,
"description": "Qt Quick 3D provides a high-level API for creating 3D content and 3D user interfaces based on Qt Quick.",
"homepage": "https://www.qt.io/",
"license": null,
"dependencies": [
"meshoptimizer",
{
"name": "qtbase",
"default-features": false,
"features": [
"gui"
]
},
"qtdeclarative",
{
"name": "qtquick3d",
"host": true,
"default-features": false
},
"qtquicktimeline",
"qtshadertools"
],
"default-features": [
"default-features"
],
"features": {
"assimp": {
"description": "assimp",
"dependencies": [
"assimp"
]
},
"default-features": {
"description": "Platform-dependent default features"
}
}
}

0 comments on commit 87a6914

Please sign in to comment.