Skip to content

Commit eb1f9c3

Browse files
committed
Use RIDs for macOS arch to let cross compile work
1 parent 695ffa4 commit eb1f9c3

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

build.libgit2.sh

+12-14
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,17 @@ SHORTSHA=${LIBGIT2SHA:0:7}
77
OS=`uname`
88
ARCH=`uname -m`
99
PACKAGEPATH="nuget.package/runtimes"
10-
OSXARCHITECTURE="x86_64"
10+
OSXARCHITECTURE=$ARCH
1111

1212
if [[ $OS == "Darwin" ]]; then
13-
USEHTTPS="ON"
14-
if [[ $ARCH == "arm64" ]]; then
15-
OSXARCHITECTURE="arm64"
16-
fi
13+
USEHTTPS="ON"
14+
if [[ $RID == "osx-arm64" ]]; then
15+
OSXARCHITECTURE="arm64"
16+
elif [[ $RID == "osx-x64" ]]; then
17+
OSXARCHITECTURE="x86_64"
18+
fi
1719
else
18-
USEHTTPS="OpenSSL-Dynamic"
20+
USEHTTPS="OpenSSL-Dynamic"
1921
fi
2022

2123
rm -rf libgit2/build
@@ -38,18 +40,14 @@ cmake --build .
3840
popd
3941

4042
if [[ $RID == "" ]]; then
41-
if [[ $ARCH == "x86_64" ]]; then
42-
RID="unix-x64"
43-
else
44-
RID="unix-x86"
45-
fi
46-
echo "$(tput setaf 3)RID not defined. Falling back to '$RID'.$(tput sgr0)"
43+
echo "$(tput setaf 3)RID not defined. Skipping copy to package path.$(tput sgr0)"
44+
exit 0
4745
fi
4846

4947
if [[ $OS == "Darwin" ]]; then
50-
LIBEXT="dylib"
48+
LIBEXT="dylib"
5149
else
52-
LIBEXT="so"
50+
LIBEXT="so"
5351
fi
5452

5553
rm -rf $PACKAGEPATH/$RID

0 commit comments

Comments
 (0)