Skip to content

Commit

Permalink
Update build_libpng.sh
Browse files Browse the repository at this point in the history
A fix to allow building the library on Mac M1/arm64
  • Loading branch information
natalie-perlin authored Nov 10, 2022
1 parent 0b79c05 commit 8ba0750
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions libs/build_libpng.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ URL="https://github.com/glennrp/libpng"
[[ ${DOWNLOAD_ONLY} =~ [yYtT] ]] && exit 0
[[ -d $software ]] && cd $software || ( echo "$software does not exist, ABORT!"; exit 1 )
sourceDir=$PWD

host=$(uname -s)
arch=$(uname -m)

if [[ $host == "Darwin" ]] && [[ $arch == "arm64" ]]; then
sed -i -e '/set(PNGLIB_VERSION*/a\'$'\n''set(PNG_ARM_NEON off CACHE INTERNAL "")'$'\n' ./CMakeLists.txt
fi

[[ -d build ]] && rm -rf build
mkdir -p build && cd build

Expand Down

0 comments on commit 8ba0750

Please sign in to comment.