Skip to content

Commit

Permalink
[meshoptimizer] Add basisu support to gltfpack (#27532)
Browse files Browse the repository at this point in the history
* Updating meshoptimizer port to add basisu support to gltfpack

* Updating version

* Using proper gltfpack branch for v0.18

* Updating version

* Adding patch to fix x86-windows

* Updating version
  • Loading branch information
Honeybunch committed Nov 9, 2022
1 parent 16f2ec1 commit 7e7c62d
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 1 deletion.
16 changes: 16 additions & 0 deletions ports/meshoptimizer/no-werror.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b13d946..1aa1304 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -55,9 +55,9 @@ set(GLTF_SOURCES
)

if(MSVC)
- add_compile_options(/W4 /WX)
+ add_compile_options(/W4)
else()
- add_compile_options(-Wall -Wextra -Wshadow -Wno-missing-field-initializers -Werror)
+ add_compile_options(-Wall -Wextra -Wshadow -Wno-missing-field-initializers)
endif()

if(MESHOPT_BUILD_SHARED_LIBS)
17 changes: 17 additions & 0 deletions ports/meshoptimizer/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,24 @@ vcpkg_from_github(
REF v0.18
SHA512 b9fd6ce61c7d7b673892ace74feb300628d4bbbba4e912dba4a756d9709b952dde45b706c581df3fd0aef1e7065ff730d1827b0d6c724d716ccf41efb1953d3e
HEAD_REF master
PATCHES
no-werror.patch
)

# If we want basisu support in gltfpack we need a particular fork of basisu
# We could modify this to support using the vcpkg version of basisu
# but since this is only necessary for the gltfpack tool and not for the
# meshopt lib it shouldn't be too nasty to just grab this repo
if ("gltfpack" IN_LIST FEATURES)
vcpkg_from_github(
OUT_SOURCE_PATH BASISU_PATH
REPO zeux/basis_universal
REF 91ca86492bc046bf1d096067a1adcd2309e13dd2
SHA512 fe80533db60b40cdc72a64f766c2447ce5c923d84467a926c2e8af4ec42e278d9fa9823b41b3fc7d9b740dd2d41d2f606f0f9990f94d2398f253bc86350a4287
HEAD_REF gltfpack
)
endif()

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
gltfpack MESHOPT_BUILD_GLTFPACK
Expand All @@ -18,6 +34,7 @@ vcpkg_cmake_configure(
OPTIONS
${FEATURE_OPTIONS}
-DMESHOPT_BUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}
-DMESHOPT_BASISU_PATH=${BASISU_PATH}
)

vcpkg_cmake_install()
Expand Down
1 change: 1 addition & 0 deletions ports/meshoptimizer/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "meshoptimizer",
"version": "0.18",
"port-version": 1,
"description": "Mesh optimization library that makes meshes smaller and faster to render",
"homepage": "https://github.com/zeux/meshoptimizer",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -4782,7 +4782,7 @@
},
"meshoptimizer": {
"baseline": "0.18",
"port-version": 0
"port-version": 1
},
"metis": {
"baseline": "2022-07-27",
Expand Down
5 changes: 5 additions & 0 deletions versions/m-/meshoptimizer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "82831888ef7242fd8d00cc2b9710d33d895d76f1",
"version": "0.18",
"port-version": 1
},
{
"git-tree": "bc06ee0eb1b2510c67f2bf0d6940fd10395990a4",
"version": "0.18",
Expand Down

0 comments on commit 7e7c62d

Please sign in to comment.