浏览代码

Fix cross-build.sh, update documentation

Vladimir Vivien 2 年之前
父节点
当前提交
5f6dc724af
共有 2 个文件被更改,包括 6 次插入7 次删除
  1. 4 1
      examples/webcam/README.md
  2. 2 6
      examples/webcam/cross-build.sh

+ 4 - 1
examples/webcam/README.md

@@ -14,7 +14,10 @@ Follow these instructions if you want to build the code for your device.
 The project uses an external package for face detection. For it to build properly, some Go modules must be specically pulled. This is done by running shell script file [./fix-mods.sh](./fix-mods.sh).
 
 ### 2. Compile the code
-See instructions for on-device compilation or off-device cross-compilation [here](../README.md). Once you have compiled the code, return here to find out how to run the example.
+See instructions for on-device compilation or off-device cross-compilation [here](../README.md).
+If you have the Zig tool chain installed, you can run [./cross-build.sh](./cross-build.sh) to cross-compile the source code.
+
+Once you have compiled the code, return here to find out how to run the example.
 
 ## Run
 

+ 2 - 6
examples/webcam/cross-build.sh

@@ -1,11 +1,7 @@
 #! /bin/bash
-# Run the following once to pull correct dependencies
-go get github.com/vladimirvivien/go4vl@latest
-go get github.com/esimov/pigo/core@latest
-go get github.com/fogleman/gg@8febc0f526adecda6f8ae80f3869b7cd77e52984
 
-go mod tidy
+./fix-mods.sh
 
-# build for 32-bit arm
+# Cross-compile using zig to build for 32-bit arm
 CGO_ENABLED=1 GOOS=linux GOARCH=arm GOARM=7 CC="zig cc -target arm-linux-musleabihf" CXX="zig c++ -target arm-linux-musleabihf" go build -o webcam .