-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add lnux arm64 build scripts for go sample
- Loading branch information
Showing
2 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
Samples/Beyond.NET.Sample.Go/build_dependencies_linux_arm64
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
cd "../Beyond.NET.Sample.Managed" | ||
./publish_managed | ||
|
||
cd "../../Generator/Beyond.NET.CodeGenerator.CLI" | ||
./publish_linux_arm64 | ||
|
||
cd "../../Samples" | ||
echo "Generating .NET Native Bindings" | ||
../Generator/Beyond.NET.CodeGenerator.CLI/bin/Release/linux-arm64/publish/beyondnetgen "Beyond.NET.Sample_Config.json" | ||
|
||
cd "Beyond.NET.Sample.Native" | ||
./publish_linux_arm64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
CGO_ENABLED=1 | ||
export CGO_ENABLED | ||
|
||
GOOS=linux | ||
export GOOS | ||
|
||
CC=clang | ||
export CC | ||
|
||
go clean -modcache | ||
|
||
OUTPUT_PRODUCT_NAME="gobeyond" | ||
LIBRARY_NAME="BeyondDotNETSampleNative" | ||
LIBRARY_FILE_NAME="lib${LIBRARY_NAME}.so" | ||
|
||
BUILD_DIR="bin" | ||
|
||
echo "Making directory for ${OUTPUT_PRODUCT_NAME} build" | ||
mkdir -p "${BUILD_DIR}" | ||
|
||
OUTPUT_FILE_PATH_ARM64="${OUTPUT_PRODUCT_NAME}" | ||
|
||
./build_dependencies_linux_arm64 | ||
|
||
rm -f "${LIBRARY_FILE_NAME}" | ||
ln -s "../Beyond.NET.Sample.Native/bin/Release/linux-arm64/publish/${LIBRARY_FILE_NAME}" "${LIBRARY_FILE_NAME}" | ||
|
||
cd "${BUILD_DIR}" | ||
|
||
echo "Copying native library" | ||
cp "../../Beyond.NET.Sample.Native/bin/Release/linux-arm64/publish/${LIBRARY_FILE_NAME}" "${LIBRARY_FILE_NAME}" | ||
|
||
echo "Building ${OUTPUT_PRODUCT_NAME} for ARM64" | ||
GOARCH=arm64 go build -o "${OUTPUT_FILE_PATH_ARM64}" ../ |