Skip to content

Commit e2d330b

Browse files
committed
Add lnux arm64 build scripts for go sample
1 parent 4ad37be commit e2d330b

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
cd "../Beyond.NET.Sample.Managed"
6+
./publish_managed
7+
8+
cd "../../Generator/Beyond.NET.CodeGenerator.CLI"
9+
./publish_linux_arm64
10+
11+
cd "../../Samples"
12+
echo "Generating .NET Native Bindings"
13+
../Generator/Beyond.NET.CodeGenerator.CLI/bin/Release/linux-arm64/publish/beyondnetgen "Beyond.NET.Sample_Config.json"
14+
15+
cd "Beyond.NET.Sample.Native"
16+
./publish_linux_arm64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
CGO_ENABLED=1
6+
export CGO_ENABLED
7+
8+
GOOS=linux
9+
export GOOS
10+
11+
CC=clang
12+
export CC
13+
14+
go clean -modcache
15+
16+
OUTPUT_PRODUCT_NAME="gobeyond"
17+
LIBRARY_NAME="BeyondDotNETSampleNative"
18+
LIBRARY_FILE_NAME="lib${LIBRARY_NAME}.so"
19+
20+
BUILD_DIR="bin"
21+
22+
echo "Making directory for ${OUTPUT_PRODUCT_NAME} build"
23+
mkdir -p "${BUILD_DIR}"
24+
25+
OUTPUT_FILE_PATH_ARM64="${OUTPUT_PRODUCT_NAME}"
26+
27+
./build_dependencies_linux_arm64
28+
29+
rm -f "${LIBRARY_FILE_NAME}"
30+
ln -s "../Beyond.NET.Sample.Native/bin/Release/linux-arm64/publish/${LIBRARY_FILE_NAME}" "${LIBRARY_FILE_NAME}"
31+
32+
cd "${BUILD_DIR}"
33+
34+
echo "Copying native library"
35+
cp "../../Beyond.NET.Sample.Native/bin/Release/linux-arm64/publish/${LIBRARY_FILE_NAME}" "${LIBRARY_FILE_NAME}"
36+
37+
echo "Building ${OUTPUT_PRODUCT_NAME} for ARM64"
38+
GOARCH=arm64 go build -o "${OUTPUT_FILE_PATH_ARM64}" ../

0 commit comments

Comments
 (0)