From 0ac6d8dd24750b1fa0df31e4079d91e05ab82717 Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Wed, 13 Oct 2021 14:32:45 +0100 Subject: [PATCH] Guard mac compilation for Mac OS X only. --- build.sh | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/build.sh b/build.sh index 9bad868..f689bd0 100644 --- a/build.sh +++ b/build.sh @@ -16,6 +16,8 @@ # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, see . +OS_NAME=`uname` + ## Android (ARM) # Detected system processor: armv7-a rm -f CMakeCache.txt @@ -190,18 +192,18 @@ docker/dockcross-win-x86 cmake -DCMAKE_BUILD_TYPE=Release docker/dockcross-win-x86 make mv libAaru.Checksums.Native.dll runtimes/win-x86/native/ -## Mac OS X (arm64 and x64 -rm -f CMakeCache.txt -cmake -DCMAKE_BUILD_TYPE=Release . -make -mkdir -p runtimes/osx-arm64/native -mkdir -p runtimes/osx-x64/native -lipo libAaru.Checksums.Native.dylib -thin arm64 -output runtimes/osx-arm64/native/libAaru.Checksums.Native.dylib -lipo libAaru.Checksums.Native.dylib -thin x86_64 -output runtimes/osx-x64/native/libAaru.Checksums.Native.dylib +## Mac OS X (arm64 and x64) +if [[ ${OS_NAME} == Darwin ]]; then + rm -f CMakeCache.txt + cmake -DCMAKE_BUILD_TYPE=Release . + make + mkdir -p runtimes/osx-arm64/native + mkdir -p runtimes/osx-x64/native + lipo libAaru.Checksums.Native.dylib -thin arm64 -output runtimes/osx-arm64/native/libAaru.Checksums.Native.dylib + lipo libAaru.Checksums.Native.dylib -thin x86_64 -output runtimes/osx-x64/native/libAaru.Checksums.Native.dylib +fi # TODO: "linux-musl-x64" # TODO: "linux-musl-x86" -# TODO: "osx-arm64" -# TODO: "osx-x64" nuget pack \ No newline at end of file