Skip to content

Commit

Permalink
Improve build script
Browse files Browse the repository at this point in the history
  • Loading branch information
ankurkotwal committed Apr 4, 2024
1 parent 36b03c2 commit 09feeef
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
#!/bin/bash

if [ `uname` == "Darwin" ]; then
brew_path=`which brew 2>/dev/null`
if [ $? -eq 0 ]; then
jpeg_turbo_path=`brew --prefix jpeg-turbo 2>/dev/null`
jpeg_turbo_version=`brew list --versions jpeg-turbo 2>/dev/null | sed -E 's/^jpeg-turbo[[:space:]]+//'`
if [ $? -eq 0 ]; then
jpeg_turbo_path="$jpeg_turbo_path/$jpeg_turb_version"
export CGO_CFLAGS="-I${jpeg_turbo_path}include"
export CGO_LDFLAGS="-L${jpeg_turbo_path}lib"
fi
fi
if [ `uname` == "Darwin" ] && [ -n "$HOMEBREW_PREFIX" ]; then
export CGO_CFLAGS="-I ${HOMEBREW_PREFIX}/include"
export CGO_LDFLAGS="-L ${HOMEBREW_PREFIX}/lib"
fi

go build -v ./...

0 comments on commit 09feeef

Please sign in to comment.