Skip to content

Commit 90a2712

Browse files
committed
Changes to compile on arm64 macOS
1 parent b740267 commit 90a2712

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

CMakeLists.txt

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ else()
100100
endif()
101101

102102
if(NOT MSVC)
103-
set(CMAKE_C_FLAGS "-fpic")
104-
set(CMAKE_CXX_FLAGS "-fpic")
103+
set(CMAKE_C_FLAGS "-fpic -Wno-error=deprecated-declarations")
104+
set(CMAKE_CXX_FLAGS "-fpic -Wno-error=deprecated-declarations")
105105
endif()
106106

107107
message("thirdparty packages will be installed to ${THIRDPARTY_DIR}")
@@ -192,6 +192,12 @@ else()
192192
endif()
193193

194194
if(BUILD_PNG)
195+
set(png_extra_flags)
196+
197+
if(APPLE)
198+
set(png_extra_flags -DPNG_ARM_NEON=on)
199+
endif()
200+
195201
ExternalProject_Add(
196202
png
197203
DEPENDS zlib
@@ -208,6 +214,7 @@ if(BUILD_PNG)
208214
-DPNG_STATIC=ON
209215
-DPNG_TESTS=OFF
210216
-DPNG_DEBUG=OFF
217+
${png_extra_flags}
211218
-DAWK= # Needed for multi-arch build on macOS
212219
INSTALL_DIR ${THIRDPARTY_DIR}/png
213220
)
@@ -232,6 +239,7 @@ if(BUILD_ASSIMP)
232239
-DASSIMP_BUILD_TESTS=OFF
233240
-DASSIMP_BUILD_ASSIMP_TOOLS=OFF
234241
-DASSIMP_NO_EXPORT=ON
242+
-DASSIMP_WARNINGS_AS_ERRORS=OFF
235243
-DLIBRARY_SUFFIX=
236244
-DZLIB_LIBRARY_DBG=${ZLIB_LIBRARY}
237245
-DZLIB_LIBRARY_REL=${ZLIB_LIBRARY}
@@ -809,7 +817,7 @@ if(BUILD_FFMPEG AND APPLE)
809817
if(arch STREQUAL "arm64")
810818
set(configure_flags --enable-cross-compile --arch=arm64 --target-os=darwin)
811819
else()
812-
set(configure_flags)
820+
set(configure_flags --arch=x86_64 --target-os=darwin)
813821
endif()
814822

815823
ExternalProject_Add(

0 commit comments

Comments
 (0)