From 61bc19222629879f29dc4c600cbeec4e057b6237 Mon Sep 17 00:00:00 2001 From: Alexandre Mutel Date: Tue, 20 Feb 2024 07:30:35 +0100 Subject: [PATCH] Fix build on macOS arm64 --- ext/CMake-Build-Platforms.ps1 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ext/CMake-Build-Platforms.ps1 b/ext/CMake-Build-Platforms.ps1 index 496c80d..1dfc80a 100755 --- a/ext/CMake-Build-Platforms.ps1 +++ b/ext/CMake-Build-Platforms.ps1 @@ -49,6 +49,13 @@ function Build-Project { $NETPlatform = "osx" $NETSharedLibExtension = "dylib" $LocalCMakeArgs += "-DCMAKE_BUILD_TYPE=$CMakeConfig" + $LocalCMakeArgs += "-DCMAKE_OSX_DEPLOYMENT_TARGET=10.10" + if ($NETArch -eq "arm64") { + $LocalCMakeArgs += "-DCMAKE_OSX_ARCHITECTURES=arm64" + } + elseif ($NETArch -eq "x64") { + $LocalCMakeArgs += "-DCMAKE_OSX_ARCHITECTURES=x86_64" + } } elseif ($IsWindows) { $MsvcArch = $NETArch