From 3a087648f548fb4d25f4a4d954d4dfcf43a93425 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Edgar=20Andr=C3=A9s=20Margffoy=20Tuay?= <andfoy@gmail.com>
Date: Mon, 22 Nov 2021 20:12:07 -0500
Subject: [PATCH] Enable arm64 support for qgltf

---
 qt3d/src/3rdparty/assimp/contrib/zip/src/miniz.h | 4 ++--
 qt3d/tools/qgltf/qgltf.pro                       | 4 ++++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/qt3d/src/3rdparty/assimp/contrib/zip/src/miniz.h b/qt3d/src/3rdparty/assimp/contrib/zip/src/miniz.h
index 2e4e223da..16da226c2 100644
--- a/qt3d/src/3rdparty/assimp/contrib/zip/src/miniz.h
+++ b/qt3d/src/3rdparty/assimp/contrib/zip/src/miniz.h
@@ -2928,8 +2928,8 @@ void *tdefl_write_image_to_png_file_in_memory(const void *pImage, int w, int h,
     #define MZ_FWRITE fwrite
     #define MZ_FTELL64 ftello64
     #define MZ_FSEEK64 fseeko64
-    #define MZ_FILE_STAT_STRUCT stat64
-    #define MZ_FILE_STAT stat64
+    #define MZ_FILE_STAT_STRUCT stat
+    #define MZ_FILE_STAT stat
     #define MZ_FFLUSH fflush
     #define MZ_FREOPEN(p, m, s) freopen64(p, m, s)
     #define MZ_DELETE_FILE remove
diff --git a/qt3d/tools/qgltf/qgltf.pro b/qt3d/tools/qgltf/qgltf.pro
index c40016015..95061d799 100644
--- a/qt3d/tools/qgltf/qgltf.pro
+++ b/qt3d/tools/qgltf/qgltf.pro
@@ -2,6 +2,10 @@ option(host_build)

 SOURCES = qgltf.cpp

+QMAKE_CXXFLAGS += -arch x86_64 -arch arm64
+QMAKE_CFLAGS += -arch x86_64 -arch arm64
+QMAKE_LFLAGS += -arch x86_64 -arch arm64
+
 include(../../src/3rdparty/assimp/assimp_dependency.pri)

 load(qt_tool)
--
2.25.1
