Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
Adds building binaries for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Cooklin authored and Joel R Cooklin committed Feb 14, 2017
1 parent 50d5776 commit 1b5b6b7
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
6 changes: 6 additions & 0 deletions scripts/build_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,10 @@ export GOARCH=amd64
"${__dir}/build_snap.sh" &
"${__dir}/build_plugins.sh" &

export GOOS=windows
export GOARCH=amd64
"${__dir}/build_snap.sh" &
"${__dir}/build_plugins.sh" &


wait
3 changes: 3 additions & 0 deletions scripts/build_plugin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ fi

plugin_src_path=$1
plugin_name=$(basename "${plugin_src_path}")
if [[ "${GOOS}" == "windows" ]]; then
plugin_name="${plugin_name}.exe"
fi
go_build=(go build -a -ldflags "-w")

_debug "plugin source: ${plugin_src_path}"
Expand Down
13 changes: 10 additions & 3 deletions scripts/build_snap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,14 @@ else
build_path="${__proj_dir}/build/${GOOS}/${GOARCH}"
fi

snaptel="snaptel"
snapteld="snapteld"
if [[ "${GOOS}" == "windows" ]]; then
snaptel="${snaptel}.exe"
snapteld="${snapteld}.exe"
fi

mkdir -p "${build_path}"
_info "building snapteld/snaptel for ${GOOS}/${GOARCH}"
"${go_build[@]}" -o "${build_path}/snapteld" . || exit 1
(cd "${__proj_dir}/cmd/snaptel" && "${go_build[@]}" -o "${build_path}/snaptel" . || exit 1)
_info "building snapteld/${snaptel} for ${GOOS}/${GOARCH}"
"${go_build[@]}" -o "${build_path}/${snapteld}" . || exit 1
(cd "${__proj_dir}/cmd/snaptel" && "${go_build[@]}" -o "${build_path}/${snaptel}" . || exit 1)

0 comments on commit 1b5b6b7

Please sign in to comment.