diff --git a/assets/libgofunc-v0.1.0-amd64.tar.gz b/assets/libgofunc-v0.1.0-amd64.tar.gz new file mode 100644 index 0000000..f3cdf7e Binary files /dev/null and b/assets/libgofunc-v0.1.0-amd64.tar.gz differ diff --git a/assets/libgofunc-v0.1.0-arm64.tar.gz b/assets/libgofunc-v0.1.0-arm64.tar.gz new file mode 100644 index 0000000..f20bd1c Binary files /dev/null and b/assets/libgofunc-v0.1.0-arm64.tar.gz differ diff --git a/assets/libgofunc-v0.1.0-armv7a.tar.gz b/assets/libgofunc-v0.1.0-armv7a.tar.gz new file mode 100644 index 0000000..b909662 Binary files /dev/null and b/assets/libgofunc-v0.1.0-armv7a.tar.gz differ diff --git a/assets/v0.1.0/libgofunc_arm64.h b/assets/v0.1.0/libgofunc_arm64.h deleted file mode 100644 index cecd6e5..0000000 --- a/assets/v0.1.0/libgofunc_arm64.h +++ /dev/null @@ -1,108 +0,0 @@ -/* Code generated by cmd/cgo; DO NOT EDIT. */ - -/* package libgofunc */ - - -#line 1 "cgo-builtin-export-prolog" - -#include - -#ifndef GO_CGO_EXPORT_PROLOGUE_H -#define GO_CGO_EXPORT_PROLOGUE_H - -#ifndef GO_CGO_GOSTRING_TYPEDEF -typedef struct { const char *p; ptrdiff_t n; } _GoString_; -extern size_t _GoStringLen(_GoString_ s); -extern const char *_GoStringPtr(_GoString_ s); -#endif - -#endif - -/* Start of preamble from import "C" comments. */ - - -#line 4 "img.go" - - #include - -#line 1 "cgo-generated-wrapper" - -#line 4 "main.go" - - #include - -#line 1 "cgo-generated-wrapper" - -#line 4 "printer.go" - - #include - -#line 1 "cgo-generated-wrapper" - - -/* End of preamble from import "C" comments. */ - - -/* Start of boilerplate cgo prologue. */ -#line 1 "cgo-gcc-export-header-prolog" - -#ifndef GO_CGO_PROLOGUE_H -#define GO_CGO_PROLOGUE_H - -typedef signed char GoInt8; -typedef unsigned char GoUint8; -typedef short GoInt16; -typedef unsigned short GoUint16; -typedef int GoInt32; -typedef unsigned int GoUint32; -typedef long long GoInt64; -typedef unsigned long long GoUint64; -typedef GoInt64 GoInt; -typedef GoUint64 GoUint; -typedef size_t GoUintptr; -typedef float GoFloat32; -typedef double GoFloat64; -#ifdef _MSC_VER -#if !defined(__cplusplus) || _MSVC_LANG <= 201402L -#include -typedef _Fcomplex GoComplex64; -typedef _Dcomplex GoComplex128; -#else -#include -typedef std::complex GoComplex64; -typedef std::complex GoComplex128; -#endif -#else -typedef float _Complex GoComplex64; -typedef double _Complex GoComplex128; -#endif - -/* - static assertion to make sure the file is being used on architecture - at least with matching size of GoInt. -*/ -typedef char _check_for_64_bit_pointer_matching_GoInt[sizeof(void*)==64/8 ? 1:-1]; - -#ifndef GO_CGO_GOSTRING_TYPEDEF -typedef _GoString_ GoString; -#endif -typedef void *GoMap; -typedef void *GoChan; -typedef struct { void *t; void *v; } GoInterface; -typedef struct { void *data; GoInt len; GoInt cap; } GoSlice; - -#endif - -/* End of boilerplate cgo prologue. */ - -#ifdef __cplusplus -extern "C" { -#endif - -extern char* GenPNG(char* outputPath, char* payload, char* tmpl); -extern GoInt Sum(GoInt a, GoInt b); -extern char* PrintImg(char* printer, char* imagePath); - -#ifdef __cplusplus -} -#endif diff --git a/assets/v0.1.0/libgofunc_armv7a.h b/assets/v0.1.0/libgofunc_armv7a.h deleted file mode 100644 index 9c7e888..0000000 --- a/assets/v0.1.0/libgofunc_armv7a.h +++ /dev/null @@ -1,108 +0,0 @@ -/* Code generated by cmd/cgo; DO NOT EDIT. */ - -/* package libgofunc */ - - -#line 1 "cgo-builtin-export-prolog" - -#include - -#ifndef GO_CGO_EXPORT_PROLOGUE_H -#define GO_CGO_EXPORT_PROLOGUE_H - -#ifndef GO_CGO_GOSTRING_TYPEDEF -typedef struct { const char *p; ptrdiff_t n; } _GoString_; -extern size_t _GoStringLen(_GoString_ s); -extern const char *_GoStringPtr(_GoString_ s); -#endif - -#endif - -/* Start of preamble from import "C" comments. */ - - -#line 4 "img.go" - - #include - -#line 1 "cgo-generated-wrapper" - -#line 4 "main.go" - - #include - -#line 1 "cgo-generated-wrapper" - -#line 4 "printer.go" - - #include - -#line 1 "cgo-generated-wrapper" - - -/* End of preamble from import "C" comments. */ - - -/* Start of boilerplate cgo prologue. */ -#line 1 "cgo-gcc-export-header-prolog" - -#ifndef GO_CGO_PROLOGUE_H -#define GO_CGO_PROLOGUE_H - -typedef signed char GoInt8; -typedef unsigned char GoUint8; -typedef short GoInt16; -typedef unsigned short GoUint16; -typedef int GoInt32; -typedef unsigned int GoUint32; -typedef long long GoInt64; -typedef unsigned long long GoUint64; -typedef GoInt32 GoInt; -typedef GoUint32 GoUint; -typedef size_t GoUintptr; -typedef float GoFloat32; -typedef double GoFloat64; -#ifdef _MSC_VER -#if !defined(__cplusplus) || _MSVC_LANG <= 201402L -#include -typedef _Fcomplex GoComplex64; -typedef _Dcomplex GoComplex128; -#else -#include -typedef std::complex GoComplex64; -typedef std::complex GoComplex128; -#endif -#else -typedef float _Complex GoComplex64; -typedef double _Complex GoComplex128; -#endif - -/* - static assertion to make sure the file is being used on architecture - at least with matching size of GoInt. -*/ -typedef char _check_for_32_bit_pointer_matching_GoInt[sizeof(void*)==32/8 ? 1:-1]; - -#ifndef GO_CGO_GOSTRING_TYPEDEF -typedef _GoString_ GoString; -#endif -typedef void *GoMap; -typedef void *GoChan; -typedef struct { void *t; void *v; } GoInterface; -typedef struct { void *data; GoInt len; GoInt cap; } GoSlice; - -#endif - -/* End of boilerplate cgo prologue. */ - -#ifdef __cplusplus -extern "C" { -#endif - -extern char* GenPNG(char* outputPath, char* payload, char* tmpl); -extern GoInt Sum(GoInt a, GoInt b); -extern char* PrintImg(char* printer, char* imagePath); - -#ifdef __cplusplus -} -#endif diff --git a/assets/v0.1.0/libgofunc_x64.h b/assets/v0.1.0/libgofunc_x64.h deleted file mode 100644 index cecd6e5..0000000 --- a/assets/v0.1.0/libgofunc_x64.h +++ /dev/null @@ -1,108 +0,0 @@ -/* Code generated by cmd/cgo; DO NOT EDIT. */ - -/* package libgofunc */ - - -#line 1 "cgo-builtin-export-prolog" - -#include - -#ifndef GO_CGO_EXPORT_PROLOGUE_H -#define GO_CGO_EXPORT_PROLOGUE_H - -#ifndef GO_CGO_GOSTRING_TYPEDEF -typedef struct { const char *p; ptrdiff_t n; } _GoString_; -extern size_t _GoStringLen(_GoString_ s); -extern const char *_GoStringPtr(_GoString_ s); -#endif - -#endif - -/* Start of preamble from import "C" comments. */ - - -#line 4 "img.go" - - #include - -#line 1 "cgo-generated-wrapper" - -#line 4 "main.go" - - #include - -#line 1 "cgo-generated-wrapper" - -#line 4 "printer.go" - - #include - -#line 1 "cgo-generated-wrapper" - - -/* End of preamble from import "C" comments. */ - - -/* Start of boilerplate cgo prologue. */ -#line 1 "cgo-gcc-export-header-prolog" - -#ifndef GO_CGO_PROLOGUE_H -#define GO_CGO_PROLOGUE_H - -typedef signed char GoInt8; -typedef unsigned char GoUint8; -typedef short GoInt16; -typedef unsigned short GoUint16; -typedef int GoInt32; -typedef unsigned int GoUint32; -typedef long long GoInt64; -typedef unsigned long long GoUint64; -typedef GoInt64 GoInt; -typedef GoUint64 GoUint; -typedef size_t GoUintptr; -typedef float GoFloat32; -typedef double GoFloat64; -#ifdef _MSC_VER -#if !defined(__cplusplus) || _MSVC_LANG <= 201402L -#include -typedef _Fcomplex GoComplex64; -typedef _Dcomplex GoComplex128; -#else -#include -typedef std::complex GoComplex64; -typedef std::complex GoComplex128; -#endif -#else -typedef float _Complex GoComplex64; -typedef double _Complex GoComplex128; -#endif - -/* - static assertion to make sure the file is being used on architecture - at least with matching size of GoInt. -*/ -typedef char _check_for_64_bit_pointer_matching_GoInt[sizeof(void*)==64/8 ? 1:-1]; - -#ifndef GO_CGO_GOSTRING_TYPEDEF -typedef _GoString_ GoString; -#endif -typedef void *GoMap; -typedef void *GoChan; -typedef struct { void *t; void *v; } GoInterface; -typedef struct { void *data; GoInt len; GoInt cap; } GoSlice; - -#endif - -/* End of boilerplate cgo prologue. */ - -#ifdef __cplusplus -extern "C" { -#endif - -extern char* GenPNG(char* outputPath, char* payload, char* tmpl); -extern GoInt Sum(GoInt a, GoInt b); -extern char* PrintImg(char* printer, char* imagePath); - -#ifdef __cplusplus -} -#endif diff --git a/build_lib.sh b/build_lib.sh index 42df23b..320bbf2 100755 --- a/build_lib.sh +++ b/build_lib.sh @@ -44,27 +44,34 @@ if [ "$OS" = "Darwin" ]; then cp ./build/ios/libgofunc.a $HOME/ws/forward_pos/native/ios/x86_64/libgofunc.a elif [ "$OS" = "Linux" ]; then - echo "Building for Android x86_64..." + echo "Building for Android amd64..." CC="$TOOLCHAIN/x86_64-linux-android$API-clang" \ CGO_ENABLED=1 GOOS=android GOARCH=amd64 \ - go build -buildmode=c-shared -o $OUTPUT_DIR/$VERSION/libgofunc_x64.so . + go build -buildmode=c-shared -o $BUILD_DIR/libgofunc_amd64.so . - echo "Building for Android ARM64..." + ARCHIVE_NAME="${APP_NAME}-${VERSION}-amd64.tar.gz" + tar -czf "${OUTPUT_DIR}/${ARCHIVE_NAME}" -C "${BUILD_DIR}" libgofunc_amd64.so + + echo "Building for Android arm64..." CC="$TOOLCHAIN/aarch64-linux-android$API-clang" \ CGO_ENABLED=1 GOOS=android GOARCH=arm64 \ - go build -buildmode=c-shared -o $OUTPUT_DIR/$VERSION/libgofunc_arm64.so . + go build -buildmode=c-shared -o $BUILD_DIR/libgofunc_arm64.so . - echo "Building for Android ARMv7..." + ARCHIVE_NAME="${APP_NAME}-${VERSION}-arm64.tar.gz" + tar -czf "${OUTPUT_DIR}/${ARCHIVE_NAME}" -C "${BUILD_DIR}" libgofunc_arm64.so + + echo "Building for Android armv7a..." CC="$TOOLCHAIN/armv7a-linux-androideabi$API-clang" \ CGO_ENABLED=1 GOOS=android GOARCH=arm GOARM=7 \ - go build -buildmode=c-shared -o $OUTPUT_DIR/$VERSION/libgofunc_armv7a.so . + go build -buildmode=c-shared -o $BUILD_DIR/libgofunc_armv7a.so . + + ARCHIVE_NAME="${APP_NAME}-${VERSION}-armv7a.tar.gz" + tar -czf "${OUTPUT_DIR}/${ARCHIVE_NAME}" -C "${BUILD_DIR}" libgofunc_armv7a.so # cp ./assets/libgofunc_x64.so $HOME/ws/forward_pos/native/android/x86_64/libgofunc.so # cp ./assets/libgofunc_arm64.so $HOME/ws/forward_pos/native/android/arm64-v8a/libgofunc.so # cp ./assets/libgofunc_armv7a.so $HOME/ws/forward_pos/native/android/armeabi-v7a/libgofunc.so - # ARCHIVE_NAME="${APP_NAME}-${VERSION}.tar.gz" - # tar -czf "${OUTPUT_DIR}/${ARCHIVE_NAME}" -C "${BUILD_DIR}" . else echo "Unsupported OS: $OS" exit 1