aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaleb Xavier Berger <caleb.x.berger@gmail.com>2021-01-18 07:44:44 -0500
committerGitHub <noreply@github.com>2021-01-18 12:44:44 +0000
commitefc91146f0476239ac737c37ae8822346c415014 (patch)
tree6ae0e1a02716226e1d426263abe6fbb5ebf1dc96
parent940577cd3c9df97d1616476dbd8498863a9a9632 (diff)
Use go build instead of go install (#1716)
* Use go build instead of go install go install doesn't like to cross-compile things. (Try running build.sh with GOARCH set to something other than what it "should" be.) With go build, it appears that cross-compilation is really, really straightforward. Simply install a compiler for your target platform and set `GOARCH` and `CC` accordingly. * Use shell expansion instead of loop Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
-rwxr-xr-xbuild.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/build.sh b/build.sh
index e5e7fe8f..09ecb61c 100755
--- a/build.sh
+++ b/build.sh
@@ -17,6 +17,6 @@ else
export FLAGS=""
fi
-go install -trimpath -ldflags "$FLAGS" -v $PWD/`dirname $0`/cmd/...
+CGO_ENABLED=1 go build -trimpath -ldflags "$FLAGS" -v -o "bin/" ./cmd/...
-GOOS=js GOARCH=wasm go build -trimpath -ldflags "$FLAGS" -o bin/main.wasm ./cmd/dendritejs
+CGO_ENABLED=0 GOOS=js GOARCH=wasm go build -trimpath -ldflags "$FLAGS" -o bin/main.wasm ./cmd/dendritejs