diff --git a/lib/install.js b/lib/install.js index ee06a8b..9e073d5 100644 --- a/lib/install.js +++ b/lib/install.js @@ -13,10 +13,15 @@ import bin from './index.js'; console.info('compiling from source'); try { + let buildFlags = '' + if (process.arch === 'arm64') { + buildFlags = 'CPPFLAGS="-DPNG_ARM_NEON_OPT=0" ' + } + const source = fileURLToPath(new URL('../vendor/source/optipng.tar.gz', import.meta.url)); // From https://sourceforge.net/projects/optipng/files/OptiPNG/ await binBuild.file(source, [ - `./configure --with-system-zlib --prefix="${bin.dest()}" --bindir="${bin.dest()}"`, + `${buildFlags}./configure --with-system-zlib --prefix="${bin.dest()}" --bindir="${bin.dest()}"`, 'make install', ]);