mirror of
https://github.com/gen2brain/cam2ip.git
synced 2026-01-09 16:18:31 +00:00
Add Android build
This commit is contained in:
@@ -18,9 +18,10 @@ or
|
||||
|
||||
Binaries are compiled with static OpenCV library:
|
||||
|
||||
- [Android 32bit](https://github.com/gen2brain/cam2ip/releases/download/1.0/cam2ip-1.0-android.tar.gz)
|
||||
- [Linux 64bit](https://github.com/gen2brain/cam2ip/releases/download/1.0/cam2ip-1.0-64bit.tar.gz)
|
||||
- [Windows 32bit](https://github.com/gen2brain/cam2ip/releases/download/1.0/cam2ip-1.0.zip)
|
||||
- [RPi 32bit](https://github.com/gen2brain/cam2ip/releases/download/1.0/cam2ip-1.0-RPi.tar.gz)
|
||||
- [Windows 32bit](https://github.com/gen2brain/cam2ip/releases/download/1.0/cam2ip-1.0.zip)
|
||||
|
||||
|
||||
### Installation
|
||||
|
||||
@@ -96,6 +96,7 @@ func (c *Camera) SetProperty(id int, value float64) int {
|
||||
func (c *Camera) Close() (err error) {
|
||||
if c.camera == nil {
|
||||
err = fmt.Errorf("camera: camera is not opened")
|
||||
return
|
||||
}
|
||||
|
||||
c.camera.Release()
|
||||
|
||||
18
make.bash
18
make.bash
@@ -3,6 +3,7 @@
|
||||
CHROOT="/usr/x86_64-pc-linux-gnu-static"
|
||||
MINGW="/usr/i686-w64-mingw32"
|
||||
RPI="/usr/armv6j-hardfloat-linux-gnueabi"
|
||||
ANDROID="/opt/android-toolchain-arm7"
|
||||
|
||||
mkdir -p build
|
||||
|
||||
@@ -10,13 +11,13 @@ LIBRARY_PATH="$CHROOT/usr/lib:$CHROOT/lib" \
|
||||
PKG_CONFIG_PATH="$CHROOT/usr/lib/pkgconfig" \
|
||||
PKG_CONFIG_LIBDIR="$CHROOT/usr/lib/pkgconfig" \
|
||||
CGO_LDFLAGS="-L$CHROOT/usr/lib -L$CHROOT/lib" \
|
||||
CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -v -x -o build/cam2ip.amd64 -ldflags "-linkmode external -s -w" github.com/gen2brain/cam2ip
|
||||
CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -v -x -o build/cam2ip.linux.amd64 -ldflags "-linkmode external -s -w" github.com/gen2brain/cam2ip
|
||||
|
||||
|
||||
PKG_CONFIG="/usr/bin/i686-w64-mingw32-pkg-config" \
|
||||
PKG_CONFIG_PATH="$MINGW/usr/lib/pkgconfig" \
|
||||
PKG_CONFIG_LIBDIR="$MINGW/usr/lib/pkgconfig" \
|
||||
CGO_LDFLAGS="-L$MINGW/usr/lib -L$MINGW/usr/include" \
|
||||
CGO_LDFLAGS="-L$MINGW/usr/lib" \
|
||||
CGO_CFLAGS="-I$MINGW/usr/include" \
|
||||
CC="i686-w64-mingw32-gcc" CXX="i686-w64-mingw32-g++" \
|
||||
CGO_ENABLED=1 GOOS=windows GOARCH=386 go build -v -x -o build/cam2ip.exe -ldflags "-linkmode external -s -w '-extldflags=-static'" github.com/gen2brain/cam2ip
|
||||
@@ -24,7 +25,16 @@ CGO_ENABLED=1 GOOS=windows GOARCH=386 go build -v -x -o build/cam2ip.exe -ldflag
|
||||
PKG_CONFIG="/usr/bin/armv6j-hardfloat-linux-gnueabi-pkg-config" \
|
||||
PKG_CONFIG_PATH="$RPI/usr/lib/pkgconfig" \
|
||||
PKG_CONFIG_LIBDIR="$RPI/usr/lib/pkgconfig" \
|
||||
CGO_LDFLAGS="-L$RPI/usr/lib -L$RPI/usr/include" \
|
||||
CGO_LDFLAGS="-L$RPI/usr/lib" \
|
||||
CGO_CFLAGS="-I$RPI/usr/include" \
|
||||
CC="armv6j-hardfloat-linux-gnueabi-gcc" CXX="armv6j-hardfloat-linux-gnueabi-g++" \
|
||||
CGO_ENABLED=1 GOOS=linux GOARCH=arm go build -v -x -o build/cam2ip.arm -ldflags "-linkmode external -s -w" github.com/gen2brain/cam2ip
|
||||
CGO_ENABLED=1 GOOS=linux GOARCH=arm go build -v -x -o build/cam2ip.linux.arm -ldflags "-linkmode external -s -w" github.com/gen2brain/cam2ip
|
||||
|
||||
PATH="$PATH:$ANDROID/bin" \
|
||||
PKG_CONFIG="$ANDROID/bin/arm-linux-androideabi-pkg-config" \
|
||||
PKG_CONFIG_PATH="$ANDROID/lib/pkgconfig" \
|
||||
PKG_CONFIG_LIBDIR="$ANDROID/lib/pkgconfig" \
|
||||
CGO_LDFLAGS="-L$ANDROID/lib" \
|
||||
CGO_CFLAGS="-I$ANDROID/include" \
|
||||
CC="arm-linux-androideabi-gcc" CXX="arm-linux-androideabi-g++" \
|
||||
CGO_ENABLED=1 GOOS=android GOARCH=arm go build -v -x -o build/cam2ip.android.arm -ldflags "-linkmode external -s -w" github.com/gen2brain/cam2ip
|
||||
|
||||
Reference in New Issue
Block a user